/* ============================================================================
   CINESTUDIO PRO — ESTILOS GENERALES, GUION HOLLYWOOD, DESGLOSE Y STORYBOARD
   ============================================================================ */

.cs-quick-navigation-backdrop { z-index: 10050; align-items: flex-start; padding-top: min(18vh, 150px); }
.cs-quick-navigation { width: min(600px, calc(100vw - 28px)); max-height: 70vh; overflow: hidden; padding: 18px; border: 1px solid var(--border-color); border-radius: 14px; background: var(--bg-panel); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.cs-quick-navigation h2 { margin: 0 0 12px; font-size: 17px; }
.cs-quick-navigation > input { width: 100%; margin-bottom: 10px; }
#cs-quick-navigation-results { display: grid; gap: 4px; max-height: 48vh; overflow-y: auto; }
.cs-quick-navigation-option { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-main); text-align: left; cursor: pointer; }
.cs-quick-navigation-option:hover, .cs-quick-navigation-option.selected { border-color: var(--border-color); background: var(--bg-hover); }
.cs-quick-navigation-option:focus-visible, #btn-quick-navigation:focus-visible { outline: 3px solid var(--accent-primary); outline-offset: 2px; }
.cs-quick-navigation-option small { color: var(--text-muted); text-align: right; }
.cs-quick-navigation-empty, .cs-quick-navigation > p { margin: 8px 0 0; color: var(--text-muted); font-size: 11px; }
#btn-quick-navigation kbd { padding: 1px 4px; border: 1px solid var(--border-color); border-radius: 4px; font-size: 10px; }
@media (max-width: 720px) { #btn-quick-navigation kbd { display: none; } .cs-quick-navigation-option { flex-direction: column; gap: 2px; } .cs-quick-navigation-option small { text-align: left; } }

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg-app: #111215;
  --bg-panel: #191b20;
  --bg-card: #23262e;
  --bg-elevated: #1e222a;
  --bg-surface: #181a20;
  --bg-hover: #2d313c;
  --bg-input: #141519;
  --border-color: #323642;
  --border: #323642;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --text-main: #f8fafc;
  --text-primary: #f8fafc;
  --text-muted: #9ca3af;
  --accent-primary: #d62828;
  --accent-primary-hover: #b91c1c;
  --accent-secondary: #ef4444;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #d62828;
  --status-green: #34d399;
  --status-amber: #fbbf24;
  --status-red: #f87171;
  --status-muted: #cbd5e1;
  --paper-bg: #fcfbf7;
  --paper-text: #111111;
  --paper-shadow: 0 12px 36px rgba(0, 0, 0, 0.58);
}

[data-theme="light"] {
  color-scheme: light;
  --bg-app: #F1F5F9;
  --bg-panel: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-elevated: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-hover: #E0F2FE;
  --bg-input: #FFFFFF;
  --border-color: #E2E8F0;
  --border: #E2E8F0;
  --shadow-sm: 0 2px 10px rgba(15, 41, 66, 0.06);
  --text-main: #0F2942;
  --text-primary: #0F2942;
  --text-muted: #475569;
  --accent-primary: #0077B6;
  --accent-primary-hover: #005596;
  --accent-secondary: #005596;
  --accent-amber: #92400E;
  --accent-green: #047857;
  --accent-red: #B91C1C;
  --status-green: #047857;
  --status-amber: #92400E;
  --status-red: #B91C1C;
  --status-muted: #475569;
  --paper-bg: #FFFFFF;
  --paper-text: #0F2942;
  --paper-shadow: 0 6px 24px rgba(15, 41, 66, 0.10);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================================
   BARRA SUPERIOR (TOPBAR)
   ============================================================================ */
.topbar {
  min-height: 46px;
  height: auto;
  background: var(--bg-panel);
  border-bottom: 2px solid #d62828;
  display: flex;
  flex-direction: column;
  padding: 4px 12px;
  gap: 4px;
  flex-shrink: 0;
  z-index: 150;
}

.topbar-row-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  flex-wrap: nowrap;
}

.topbar-row-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.topbar-utility-btns,
.topbar .topbar-actions {
  margin-left: auto;
  flex-wrap: wrap;
  gap: 5px;
}

.topbar .btn-sm {
  padding: 3px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.brand-logo-img-wrap {
  width: 34px;
  height: 34px;
  background: transparent !important;
  border-radius: 7px;
  padding: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  border: none;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.company-pill {
  background: #d62828;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  padding: 2px 7px;
  border-radius: 3px;
  border-top: 1.5px dashed rgba(255,255,255,0.85);
  border-bottom: 1.5px dashed rgba(255,255,255,0.85);
  white-space: nowrap;
}

/* Pastilla Oficial de Productora y Contacto en el Menú Superior */
.topbar-company-badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2px 8px;
  background: rgba(214, 40, 40, 0.09);
  border: 1px solid rgba(214, 40, 40, 0.32);
  border-radius: 7px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  user-select: none;
  line-height: 1.15;
}

.topbar-company-badge:hover {
  background: rgba(214, 40, 40, 0.18);
  border-color: rgba(214, 40, 40, 0.6);
  transform: translateY(-1px);
}

.topbar-company-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.topbar-company-title strong {
  color: #ff8787;
  font-weight: 800;
}

.topbar-company-sub {
  font-size: 8.5px;
  color: #fcd34d;
  font-weight: 700;
  opacity: 0.95;
}

.topbar-company-details {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: #cbd5e1;
  margin-top: 1px;
}

.topbar-company-details strong {
  color: #f1f5f9;
}

.topbar-company-details .t-sep {
  color: rgba(255, 255, 255, 0.35);
}

.sidebar-brand-footer {
  padding: 10px 12px;
  background: #141519;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  padding: 2px;
  border: 1px solid #d62828;
}

.project-title-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  width: 215px;
}

.project-title-input:hover,
.project-title-input:focus {
  border-color: var(--border-color);
  background: var(--bg-input);
  outline: none;
}

.project-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.28);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

[data-theme="light"] .project-meta {
  background: #F1F5F9;
  border-color: #CBD5E1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.save-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-green, #10b981);
  font-weight: 700;
  transition: color 0.2s ease;
}

.stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-amber, #f59e0b);
  font-weight: 700;
}

.topbar-center,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.revision-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: var(--bg-card);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.revision-selector select {
  background: transparent;
  color: var(--text-main);
  border: none;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.revision-selector select option {
  background: var(--bg-panel);
  color: var(--text-main);
}

.view-context-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  animation: fadeInTb 0.18s ease-in-out;
}

@keyframes fadeInTb {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   BOTONES Y FORMULARIOS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-main);
  background: var(--bg-card);
  white-space: nowrap;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-accent {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #ffffff;
}

.btn-accent:hover {
  filter: brightness(1.1);
}

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

.btn-ghost:hover,
.btn-ghost.active {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 26px;
  height: 26px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg-hover);
}

.full-width {
  width: 100%;
}

.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mt-8 { margin-top: 8px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

/* Dropdown de Exportación */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 270px;
  padding: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
}

.dropdown-menu.open {
  display: flex;
}

.dropdown-menu button {
  background: transparent;
  border: none;
  color: var(--text-main);
  text-align: left;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}

.dropdown-menu button:hover {
  background: var(--bg-hover);
}

.dropdown-menu hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 4px 0;
}

/* ============================================================================
   LAYOUT PRINCIPAL Y BARRA LATERAL
   ============================================================================ */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar-nav {
  width: 245px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.nav-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: none;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border-left: 3px solid var(--accent-primary);
}

.nav-text {
  flex: 1;
}

.nav-badge {
  font-size: 10px;
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

/* Navegador rápido de escenas */
.scene-navigator {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scene-nav-header {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.5px;
}

.sidebar-scene-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scene-nav-item {
  padding: 7px 9px;
  border-radius: 6px;
  background: var(--bg-card);
  border-left: 3px solid var(--accent-primary);
  cursor: pointer;
  font-size: 11.5px;
  transition: background 0.12s;
}

.scene-nav-item:hover,
.scene-nav-item.active {
  background: var(--bg-hover);
}

.scene-nav-item-title {
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-nav-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ============================================================================
   ESPACIO DE TRABAJO Y VISTAS
   ============================================================================ */
.main-workspace {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view-section {
  display: none;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}

.view-section.active {
  display: flex;
}

.module-header {
  padding: 7px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
  min-width: 0;
}

.module-header h2 {
  font-size: 16.5px;
  font-weight: 700;
}

.module-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.module-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
}

/* ============================================================================
   VISTA 1: EDITOR DE GUION DE CINE (FORMATO HOLLYWOOD)
   ============================================================================ */
.script-toolbar {
  padding: 8px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.element-buttons {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.el-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.el-btn:hover {
  background: var(--bg-hover);
}

.el-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.el-key {
  font-size: 10px;
  opacity: 0.65;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 4px;
  border-radius: 3px;
}

.toolbar-right-tools {
  display: flex;
  gap: 6px;
}

/* ============================================================================
   PANEL DE ESCRITURA EN BLANCO PURO (MÁXIMA LEGIBILIDAD PROFESIONAL)
   ============================================================================ */
#view-script {
  background: #ffffff !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

#view-script .script-workspace-body {
  background: #ffffff !important;
  flex: 1;
  display: flex;
  overflow: hidden;
  width: 100%;
  height: calc(100% - 46px);
}

#view-script .script-scroll-container {
  background: #ffffff !important;
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 24px 32px 120px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.script-page {
  width: 100% !important;
  max-width: 980px;
  min-height: 1056px;
  background: #ffffff !important;
  color: #000000 !important;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08) !important;
  padding: 56px 64px 80px 88px;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: 12pt;
  line-height: 1.25;
  position: relative;
  border-radius: 4px;
  border: 1px solid #e2e8f0 !important;
  box-sizing: border-box;
}

.script-block {
  color: #0f172a !important;
}

.script-block[data-type="scene"] {
  background: #eff6ff !important;
  color: #1e3a8a !important;
  border-left: 4px solid #2563eb !important;
}

.script-block[data-type="character"] {
  color: #000000 !important;
  font-weight: 800 !important;
}

.script-block[data-type="dialogue"] {
  color: #111827 !important;
}

.script-block[data-type="action"] {
  color: #1f2937 !important;
}

.script-block[data-type="parenthetical"] {
  color: #374151 !important;
}

.script-block[data-type="transition"] {
  color: #111827 !important;
}

.shortcut-hint-bar {
  max-width: 816px;
  width: 100%;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
  font-size: 11.5px;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
}

.shortcut-hint-bar kbd {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  color: #0f172a !important;
}

/* Colores de revisión estándar de Hollywood */
.script-page[data-revision="blue"] { background: #e6f2ff; }
.script-page[data-revision="pink"] { background: #ffe6f0; }
.script-page[data-revision="yellow"] { background: #fffbe6; }
.script-page[data-revision="green"] { background: #e8f8ed; }
.script-page[data-revision="goldenrod"] { background: #fdefd2; }

/* Bloques del Guion */
.script-block-wrapper {
  position: relative;
  group: block;
}

.script-block {
  outline: none;
  min-height: 1.25em;
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
}

.script-block:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

/* 1. Encabezado de Escena (Slugline) */
.script-block[data-type="scene"] {
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 22px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.055);
  padding: 4px 8px;
  border-left: 3px solid #3b82f6;
  letter-spacing: 0.3px;
}

.scene-number-left,
.scene-number-right {
  position: absolute;
  top: 24px;
  font-weight: 700;
  color: #475569;
  font-size: 11pt;
  user-select: none;
}

.scene-number-left { left: -46px; }
.scene-number-right { right: -36px; }

/* 2. Acción */
.script-block[data-type="action"] {
  margin-top: 8px;
  margin-bottom: 8px;
  width: 100%;
}

/* 3. Personaje */
.script-block[data-type="character"] {
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 0;
  margin-left: 200px;
  width: 300px;
}

/* 4. Acotación (Parenthetical) */
.script-block[data-type="parenthetical"] {
  margin-left: 145px;
  width: 240px;
  font-style: italic;
  margin-top: 1px;
  margin-bottom: 1px;
}

/* 5. Diálogo */
.script-block[data-type="dialogue"] {
  margin-left: 95px;
  width: 375px;
  margin-top: 2px;
  margin-bottom: 8px;
}

/* 6. Diálogo Dual (2 columnas) */
.script-block[data-type="dual"] {
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
}

/* 7. Transición */
.script-block[data-type="transition"] {
  text-transform: uppercase;
  font-weight: 700;
  text-align: right;
  margin-top: 12px;
  margin-bottom: 12px;
}

/* 8. Plano de Cámara (Shot) */
.script-block[data-type="shot"] {
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 10px;
  margin-bottom: 6px;
  color: #1e3a8a;
}

/* Asterisco de revisión en margen derecho */
.revision-mark {
  position: absolute;
  right: -20px;
  top: 2px;
  font-weight: bold;
  color: #dc2626;
  user-select: none;
}

/* Botón flotante de eliminar bloque al pasar el ratón */
.block-delete-btn {
  position: absolute;
  left: -76px;
  top: 2px;
  opacity: 0;
  background: #fee2e2;
  color: #b91c1c;
  border: none;
  border-radius: 4px;
  font-size: 10px;
  padding: 2px 5px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.script-block-wrapper:hover .block-delete-btn {
  opacity: 1;
}

/* Inspector Lateral de la Escena Activa */
.script-inspector {
  width: 320px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.inspector-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspector-header h3 {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  font-size: 10.5px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 700;
}

.badge-accent {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border-color: #8b5cf6;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.insp-tab {
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.insp-tab.active {
  color: var(--text-main);
  border-bottom-color: var(--accent-primary);
  background: var(--bg-panel);
}

.insp-panel {
  display: none;
  padding: 12px;
  flex: 1;
  overflow-y: auto;
}

.insp-panel.active {
  display: block;
}

.insp-quick-add {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.insp-quick-add select {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 6px;
  border-radius: 5px;
  font-size: 12px;
}

.insp-input-row {
  display: flex;
  gap: 4px;
}

.insp-input-row input {
  flex: 1;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12px;
}

.insp-items-list,
.insp-shots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.insp-need-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.insp-shot-mini {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.insp-shot-mini img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

.insp-shot-mini-info {
  padding: 6px 8px;
  font-size: 11px;
}

.color-swatches {
  display: flex;
  gap: 8px;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  cursor: pointer;
}

/* Autocompletado emergente */
.autocomplete-popup {
  position: fixed;
  background: var(--bg-panel);
  border: 1px solid var(--accent-primary);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  z-index: 200;
  min-width: 220px;
  max-height: 180px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: 7px 12px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-main);
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--accent-primary);
  color: #ffffff;
}

/* Modo Enfoque */
body.focus-mode .sidebar-nav,
body.focus-mode .script-inspector {
  display: none !important;
}

/* ============================================================================
   VISTA 2: LISTADO DE NECESIDADES DE CADA ESCENA (BREAKDOWN)
   ============================================================================ */
.breakdown-controls {
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.filter-group .form-select {
  width: auto;
  min-width: 180px;
}

.breakdown-summary-pills {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.breakdown-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 60px 24px;
  display: block;
}

.scene-breakdown-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.scene-breakdown-header {
  padding: 14px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.scene-breakdown-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scene-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 16px;
}

.need-category-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.need-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.need-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  background: var(--bg-panel);
  padding: 6px 8px;
  border-radius: 5px;
}

.need-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-ready { background: #10b981; }
.status-pending { background: #f59e0b; }

.need-add-inline {
  display: flex;
  gap: 4px;
  margin-top: auto;
}

.need-add-inline input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 11.5px;
}

/* Matriz de Desglose */
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
}

.matrix-table th,
.matrix-table td {
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.matrix-table th {
  background: var(--bg-card);
  font-weight: 700;
}

/* ============================================================================
   VISTA 3: STORYBOARD / HISTORIAS GRÁFICAS POR IA (SECUENCIA Y PLANO)
   ============================================================================ */
.storyboard-workspace-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.storyboard-center-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.storyboard-right-panel {
  width: 312px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.storyboard-right-panel.collapsed {
  display: none !important;
}

/* Hiding/Collapsing Global Left Sidebar & Fullscreen Workspace Modes */
body.cs-left-sidebar-hidden .sidebar-nav {
  display: none !important;
}

.sidebar-nav.is-collapsed #btn-hide-left-sidebar {
  display: none !important;
}

#cs-fullscreen-exit-fab {
  display: none;
  position: fixed;
  bottom: 14px;
  right: 18px;
  z-index: 9800;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border: 1.5px solid #d62828;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

#cs-fullscreen-exit-fab:hover {
  background: #d62828;
  color: #ffffff;
}

body.cs-workspace-fullscreen .topbar {
  display: none !important;
}

body.cs-workspace-fullscreen #cs-fullscreen-exit-fab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.cs-storyboard-fullscreen .topbar,
body.cs-storyboard-fullscreen .workflow-ribbon,
body.cs-storyboard-fullscreen #view-storyboard .area-id-bar {
  display: none !important;
}

body.cs-storyboard-fullscreen #cs-fullscreen-exit-fab {
  display: none !important;
}

body.cs-storyboard-fullscreen .storyboard-sequences-container {
  padding: 10px 14px 36px 14px;
}

body.cs-storyboard-fullscreen .storyboard-right-panel {
  width: 295px;
  padding: 8px;
  gap: 8px;
}

.sb-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 11px 12px;
}

.sb-panel-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #93c5fd;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 5px;
}

.storyboard-toolbar {
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.storyboard-sequences-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 60px 20px;
  display: block;
}

@media (max-width: 980px) {
  .storyboard-workspace-body { flex-direction: column; overflow-y: auto; }
  .storyboard-center-workspace { overflow: visible; flex: none; }
  .storyboard-right-panel { width: 100%; border-left: none; border-top: 1px solid var(--border-color); max-height: 440px; }
}

.sequence-story-block {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 26px;
  flex-shrink: 0;
}

.sequence-story-header {
  padding: 14px 20px;
  background: linear-gradient(90deg, var(--bg-card), var(--bg-panel));
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.shots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  padding: 16px;
}

.shot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, border-color 0.15s;
}

.shot-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.shot-frame-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 640 / 440;
  background: #ffffff;
  overflow: hidden;
}

.shot-frame-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.shot-overlay-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.shot-code-pill {
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.2);
}

.shot-tech-pill {
  background: rgba(59, 130, 246, 0.88);
  color: #fff;
  font-weight: 600;
  font-size: 10.5px;
  padding: 3px 7px;
  border-radius: 5px;
}

.shot-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.shot-meta-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}

.shot-desc-text {
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.4;
}

.shot-audio-text {
  font-size: 11.5px;
  font-style: italic;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
  padding: 5px 8px;
  border-radius: 5px;
  border-left: 2px solid var(--accent-amber);
}

.shot-card-actions {
  padding: 8px 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: 6px;
  background: rgba(0, 0, 0, 0.12);
}

/* ============================================================================
   VISTA 4: ESCALETA DE TARJETAS (CORKBOARD)
   ============================================================================ */
.corkboard-grid {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  align-content: start;
}

.index-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.index-card-top {
  padding: 10px 14px;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.index-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.index-card-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================================
   VISTA 5: BIBLIA DE PRODUCCIÓN (PERSONAJES Y LOCACIONES)
   ============================================================================ */
.bible-layout {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.75fr);
  gap: 20px;
}

@media (max-width: 1120px) {
  .bible-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.bible-col-title {
  font-size: 15px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.bible-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bible-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================================
   VISTA 6: PLAN DE RODAJE (STRIPBOARD) Y HOJA DE LLAMADO (CALL SHEET)
   ============================================================================ */
.schedule-legend {
  padding: 10px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.strip-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* Colores oficiales de tiras de producción */
.strip-int-day { background: #f8fafc; color: #0f172a; border: 1px solid #cbd5e1; }
.strip-ext-day { background: #fef08a; color: #713f12; border: 1px solid #facc15; }
.strip-int-night { background: #bae6fd; color: #0c4a6e; border: 1px solid #38bdf8; }
.strip-ext-night { background: #bbf7d0; color: #14532d; border: 1px solid #4ade80; }

.schedule-workspace {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  min-width: 0;
}

.shoot-day-group {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

.shoot-day-header {
  padding: 10px 14px;
  background: var(--bg-card);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.strip-row {
  display: grid;
  grid-template-columns: 50px 1fr 70px 110px 90px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

.callsheet-sheet {
  background: #ffffff;
  color: #0f172a;
  padding: 24px;
  border-radius: 8px;
  box-shadow: var(--paper-shadow);
  font-size: 12px;
}

.callsheet-sheet h3 {
  font-size: 18px;
  text-transform: uppercase;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.callsheet-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  margin-bottom: 16px;
}

.callsheet-table th,
.callsheet-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
  text-align: left;
  font-size: 11.5px;
}

.callsheet-table th {
  background: #f1f5f9;
}

/* ============================================================================
   VISTA 7: LECTURA DE MESA CON VOZ (TABLE READ)
   ============================================================================ */
.tableread-layout {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 420px 1fr;
}

.tableread-controls {
  padding: 16px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  min-height: 0;
}

.tableread-stage {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  min-height: 0;
}

.tableread-current-speaker {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-amber);
  margin-bottom: 10px;
}

.tableread-current-text {
  font-size: 22px;
  font-weight: 600;
  max-width: 720px;
  text-align: center;
  padding: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 24px;
}

.tableread-script-follow {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tts-line-item {
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg-card);
  font-size: 13px;
  cursor: pointer;
}

.tts-line-item.active {
  border: 2px solid var(--accent-primary);
  background: rgba(59, 130, 246, 0.15);
}

/* ============================================================================
   VISTA 8: ESTADÍSTICAS DEL GUION
   ============================================================================ */
.stats-dashboard {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  align-content: start;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
}

.stat-big-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-primary);
  margin: 6px 0;
}

.bar-row {
  margin-top: 8px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 3px;
}

.bar-track {
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 4px;
}

/* ============================================================================
   MODALES (PORTADA, ANIMATIC, EDITOR DE PLANO)
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.modal-backdrop.hidden,
.hidden {
  display: none !important;
}

.modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.modal-lg { max-width: 960px; }
.modal-xl { max-width: 1060px; }

.modal-header {
  padding: 14px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 18px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Modales Pro Overlay y Contenedores Suite 8 / Suite 10 dentro de Área 01 */
.cs-pro-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100090;
  overflow-y: auto;
}

.cs-pro-modal {
  background: var(--bg-panel, #191b20);
  color: var(--text-main, #f8fafc);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  width: min(1060px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.cs-pro-modal-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.cs-pro-modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.cs-pro-close {
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.cs-pro-close:hover {
  background: #d62828;
  border-color: #f87171;
  color: #ffffff;
}

.cs-pro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.cs-pro-btn-secondary {
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.35);
}

.cs-suite-view-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 28px;
  gap: 14px;
}

.cs-suite-view-header {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18), rgba(2, 132, 199, 0.18), rgba(168, 85, 247, 0.18));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Editor de Plano IA */
.shot-editor-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

.shot-editor-canvas-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#shot-draw-canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  cursor: crosshair;
}

.canvas-draw-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 11.5px;
}

/* Reproductor Animatic */
.animatic-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}

.animatic-screen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.animatic-overlay-top {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 8px;
}

.animatic-subtitles {
  position: absolute;
  bottom: 18px;
  left: 10%;
  right: 10%;
  background: rgba(0, 0, 0, 0.78);
  color: #fef08a;
  text-align: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
}

.animatic-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

/* ============================================================================
   PRESUPUESTO DESGLOSADO POR DEPARTAMENTOS (RED MOUSE FILMS)
   ============================================================================ */
.budget-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.budget-kpi-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
}

.budget-kpi-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin: 4px 0;
}

.budget-kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.budget-distribution-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
}

.budget-stacked-bar {
  width: 100%;
  height: 18px;
  background: var(--bg-card);
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
}

.budget-legend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.budget-inline-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
}

.budget-inline-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ============================================================================
   COLABORACIÓN DE EMPRESA Y AVATARES EN TIEMPO REAL
   ============================================================================ */
.btn-team-online {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid #10b981;
  color: #a7f3d0;
}

.status-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.led-online {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.led-local {
  background: #f59e0b;
}

.team-avatars-stack {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}

.team-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-panel);
  margin-left: -6px;
}

.team-avatar:first-child {
  margin-left: 0;
}

/* ============================================================================
   MEJORA DE INTERFAZ Y ORGANIZACIÓN POR FASES DE PRODUCCIÓN (UI PRO 2.0)
   ============================================================================ */
.workflow-ribbon {
  height: 32px;
  background: linear-gradient(90deg, #14161c 0%, #1b1f2a 50%, #14161c 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  gap: 6px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.workflow-ribbon::-webkit-scrollbar {
  height: 3px;
}

.workflow-steps {
  display: flex;
  align-items: center;
  gap: 3px;
}

.wf-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.wf-step:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-color);
}

.wf-step.active {
  background: rgba(214, 40, 40, 0.2);
  color: #ffffff;
  border-color: #d62828;
  box-shadow: 0 2px 8px rgba(214, 40, 40, 0.28);
}

.wf-step-num {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wf-step.active .wf-step-num {
  background: #d62828;
  color: #ffffff;
}

.wf-arrow {
  color: #4b5563;
  font-size: 10px;
  user-select: none;
}

.project-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.health-bar-track {
  width: 64px;
  height: 6px;
  background: #111318;
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.health-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Barra lateral organizada por secciones con Dock Inferior Fijo */
.sidebar-nav {
  width: 218px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  min-height: 0;
  transition: width 0.18s ease;
}

.nav-list {
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--border-color);
  overflow-y: auto;
  flex: 1;
  min-height: 160px;
  max-height: none;
}

.scene-navigator {
  max-height: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  transition: max-height 0.25s ease;
}

.nav-group-label {
  font-size: 9.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #64748b;
  padding: 7px 8px 2px 8px;
  user-select: none;
}

.nav-group-label:first-child {
  padding-top: 2px;
}

.nav-item {
  padding: 7px 10px;
  font-size: 12.5px;
  border-radius: 6px;
}

.sidebar-bottom-dock {
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(17, 19, 25, 0.95), #12141a);
  border-top: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.sidebar-bottom-dock .nav-item {
  padding: 9px 11px;
  font-size: 12.5px;
}

/* ============================================================================
   PANEL Y BOTÓN DE ACCESO DE USUARIOS (RBAC) DESTACADO Y ELEGANTE
   ============================================================================ */
.topbar-user-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(214, 40, 40, 0.22), rgba(20, 24, 33, 0.95));
  border: 1.5px solid #d62828;
  border-radius: 24px;
  padding: 4px 12px 4px 10px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(214, 40, 40, 0.25);
  transition: all 0.16s ease;
  user-select: none;
}

.topbar-user-auth-btn:hover {
  background: linear-gradient(135deg, rgba(214, 40, 40, 0.35), rgba(30, 36, 48, 0.98));
  border-color: #ef4444;
  box-shadow: 0 4px 14px rgba(214, 40, 40, 0.4);
  transform: translateY(-1px);
}

.user-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  flex-shrink: 0;
}

.user-auth-icon {
  font-size: 15px;
  line-height: 1;
}

.user-auth-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.user-auth-text strong {
  font-size: 12px;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.user-role-pill {
  font-size: 9.5px;
  font-weight: 900;
  color: #fca5a5;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.user-auth-arrow {
  font-size: 10px;
  color: #94a3b8;
  margin-left: 2px;
}

/* Tarjeta de usuario en el menú lateral izquierdo */
.sidebar-user-card {
  margin: 10px 10px 6px 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1.5px solid rgba(214, 40, 40, 0.45);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-user-card:hover {
  background: linear-gradient(135deg, rgba(40, 53, 76, 0.85), rgba(20, 28, 48, 0.95));
  border-color: #d62828;
  box-shadow: 0 4px 12px rgba(214, 40, 40, 0.25);
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d62828, #991b1b);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ff8787;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role-badge {
  font-size: 9.5px;
  font-weight: 900;
  color: #fca5a5;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-sub {
  font-size: 9px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-switch-btn {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #cbd5e1;
  flex-shrink: 0;
}

/* Acordeón del Navegador de Escenas */
.scene-navigator.is-collapsed .sidebar-scene-list {
  display: none !important;
}

.scene-navigator.is-collapsed {
  max-height: 36px !important;
}

/* ============================================================================
   MODO SIN DISTRACCIONES A PANTALLA COMPLETA (ZEN WRITING MODE)
   ============================================================================ */
body.zen-fullscreen-mode .topbar,
body.zen-fullscreen-mode .workflow-ribbon,
body.zen-fullscreen-mode .sidebar-nav,
body.zen-fullscreen-mode .script-inspector,
body.zen-fullscreen-mode .shortcut-hint-bar {
  display: none !important;
}

body.zen-fullscreen-mode .app-layout {
  height: 100vh !important;
  width: 100vw !important;
}

body.zen-fullscreen-mode .main-workspace {
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
}

body.zen-fullscreen-mode #view-script {
  height: 100vh !important;
  width: 100vw !important;
}

body.zen-fullscreen-mode .script-scroll-container {
  height: 100vh !important;
  padding: 40px 20px 140px 20px !important;
  background: #ffffff !important;
}

body.zen-fullscreen-mode .script-page {
  max-width: 900px !important;
  box-shadow: none !important;
  border: none !important;
}

.zen-exit-floating-btn {
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  transition: all 0.2s;
  opacity: 0.75;
}

.zen-exit-floating-btn:hover {
  opacity: 1;
  background: #d62828;
  transform: scale(1.04);
}

/* ============================================================================
   GRUPOS DESPLEGABLES DEL MENÚ LATERAL Y ACCESO RESTRINGIDO POR ROL
   ============================================================================ */
.sidebar-group-details {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 3px;
}

.sidebar-group-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  padding: 6px 8px 4px 8px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #94a3b8;
  transition: color 0.15s;
}

.sidebar-group-details summary::-webkit-details-marker {
  display: none;
}

.sidebar-group-details summary:hover {
  color: #f1f5f9;
}

.sidebar-group-chevron {
  font-size: 9px;
  transition: transform 0.2s ease;
  color: #64748b;
}

.sidebar-group-details[open] .sidebar-group-chevron {
  transform: rotate(90deg);
  color: #cbd5e1;
}

.sidebar-group-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px 0;
}

/* Estado de ítem restringido por RBAC */
.nav-item.is-restricted {
  opacity: 0.55;
  background: rgba(0, 0, 0, 0.2) !important;
  cursor: pointer;
}

.nav-item.is-restricted:hover {
  opacity: 0.85;
  background: rgba(239, 68, 68, 0.12) !important;
}

.nav-item.is-restricted .nav-badge {
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 8.5px;
  font-weight: 900;
}

/* ============================================================================
   PANEL DE GESTIÓN Y ALTA DE USUARIOS (RBAC)
   ============================================================================ */
.users-mgmt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
  border-bottom: 1.5px solid var(--border-color);
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 20px;
}

.user-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: all 0.2s ease;
}

.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.user-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d62828, #991b1b);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ff8787;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Marca de Agua Forense contra Filtraciones */
.forensic-watermark-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.055;
  transform: rotate(-35deg);
  font-size: 24px;
  font-weight: 900;
  color: #000000;
  text-align: center;
  line-height: 1.8;
  letter-spacing: 2px;
  user-select: none;
}

/* ============================================================================
   ESTILOS DE IMPRESIÓN OFICIAL (@media print)
   ============================================================================ */
@media print {
  .forensic-watermark-overlay {
    opacity: 0.12 !important;
    color: #000000 !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    height: auto !important;
    overflow: visible !important;
  }

  .no-print {
    display: none !important;
  }

  .app-layout,
  .main-workspace,
  .view-section.active,
  .script-workspace-body,
  .script-scroll-container,
  .breakdown-content,
  .storyboard-sequences-container,
  #legal-registry-platform-container {
    overflow: visible !important;
    height: auto !important;
    display: block !important;
    padding: 0 !important;
  }

  #safereg-official-certificate-sheet {
    box-shadow: none !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  body.cs-print-cert-plus-script #safereg-official-certificate-sheet {
    page-break-after: always !important;
    break-after: page !important;
  }

  #safereg-script-appendix-sheet:not(.no-print) {
    display: block !important;
    box-shadow: none !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    border: none !important;
    page-break-before: always !important;
  }

  #safereg-script-appendix-sheet.no-print {
    display: none !important;
  }

  .safereg-script-page {
    box-shadow: none !important;
    border: none !important;
    page-break-after: always !important;
    padding: 0.4in 0.5in !important;
  }

  .script-page {
    box-shadow: none !important;
    width: 100% !important;
    padding: 0.5in 0.5in 0.5in 1in !important;
  }

  .block-delete-btn {
    display: none !important;
  }

  .scene-breakdown-card,
  .sequence-story-block,
  .shot-card {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 16px;
    border: 1px solid #94a3b8 !important;
    background: #fff !important;
    color: #000 !important;
  }
}

/* ============================================================================
   TESTER DE SISTEMA Y DIAGNÓSTICO (ADMINISTRADOR EXCLUSIVO)
   ============================================================================ */
.tester-modal-card {
  max-width: 1060px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border: 1.5px solid rgba(139, 92, 246, 0.45);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(124, 58, 237, 0.25);
  border-radius: 14px;
  overflow: hidden;
  color: #f8fafc;
}

.tester-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tester-kpi-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tester-kpi-val {
  font-size: 20px;
  font-weight: 900;
  color: #c084fc;
}

.tester-kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.tester-table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.tester-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tester-table th {
  text-align: left;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(139, 92, 246, 0.4);
}

.tester-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.tester-table tr:hover td {
  background: rgba(139, 92, 246, 0.08);
}

.tester-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.tester-status-badge.pass {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.tester-status-badge.running {
  background: rgba(139, 92, 246, 0.25);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.5);
}

.tester-status-badge.pending {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.tester-status-badge.fail {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

/* ============================================================================
   CENTRO DE PRODUCCIÓN Y PANEL EJECUTIVO (DASHBOARD HUB)
   ============================================================================ */
.dashboard-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-header-banner {
  background: linear-gradient(135deg, rgba(214, 40, 40, 0.16) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1.5px solid rgba(214, 40, 40, 0.4);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.dashboard-header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-header-logo {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  background: #ffffff;
  border-radius: 10px;
  padding: 3px;
  border: 1.5px solid #d62828;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(214, 40, 40, 0.35);
  flex-shrink: 0;
}

.dashboard-header-logo img {
  width: 100%;
  height: 100%;
  max-width: 50px;
  max-height: 50px;
  object-fit: contain;
}

.dashboard-badge-pill {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ff8787;
  text-transform: uppercase;
}

.dashboard-title {
  margin: 3px 0 6px 0;
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.dashboard-sub-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  flex-wrap: wrap;
}

.dashboard-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.dash-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dash-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(214, 40, 40, 0.6);
  box-shadow: 0 6px 18px rgba(214, 40, 40, 0.2);
}

.dash-kpi-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.dash-kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-kpi-val {
  font-size: 19px;
  font-weight: 900;
  color: var(--text-main);
  margin: 2px 0;
}

.dash-kpi-hint {
  font-size: 10.5px;
  color: #94a3b8;
}

.dash-section-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.dash-module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.2s ease;
}

.dash-module-card:hover {
  border-color: rgba(214, 40, 40, 0.5);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.dash-mod-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-mod-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.dash-mod-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.dash-mod-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-top: 2px;
  display: inline-block;
}

.dash-mod-desc {
  margin: 0;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
  flex-grow: 1;
}

.dash-mod-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dashboard-corporate-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(214, 40, 40, 0.3);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* ==========================================================================
   AISLAMIENTO ESTRICTO DE VISTAS Y PANTALLA NO DIVIDIDA
   ========================================================================== */
.view-section:not(.active) {
  display: none !important;
}

body:not([data-active-view="script"]) #view-script,
body:not([data-active-view="script"]) #sidebar-scene-navigator {
  display: none !important;
}

#script-inspector {
  flex-shrink: 0;
}

/* Barra identificadora de Área de Pantalla para Edición y Programación */
.area-id-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 12px;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  color: #cbd5e1;
  flex-shrink: 0;
}

/* Botón Colapsable y Barra Lateral Compacta (Optimización de Espacio UX) */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(214, 40, 40, 0.14);
  color: #ffffff;
}

.sidebar-nav.is-collapsed {
  width: 54px;
}

.sidebar-nav.is-collapsed .sidebar-collapse-btn {
  justify-content: center;
  padding: 7px 4px;
}

.sidebar-nav.is-collapsed .sidebar-collapse-label,
.sidebar-nav.is-collapsed .sidebar-collapse-arrow,
.sidebar-nav.is-collapsed .nav-text,
.sidebar-nav.is-collapsed .nav-badge,
.sidebar-nav.is-collapsed .sidebar-group-chevron,
.sidebar-nav.is-collapsed .sidebar-group-details summary span,
.sidebar-nav.is-collapsed .scene-navigator,
.sidebar-nav.is-collapsed .sidebar-brand-footer .brand-copy,
.sidebar-nav.is-collapsed #sidebar-bottom-user-card > div:last-child {
  display: none !important;
}

.sidebar-nav.is-collapsed .sidebar-group-details summary {
  padding: 3px 0;
  justify-content: center;
  min-height: 10px;
}

.sidebar-nav.is-collapsed .sidebar-group-details summary::after {
  content: '•••';
  font-size: 9px;
  color: #64748b;
  letter-spacing: 2px;
}

.sidebar-nav.is-collapsed .nav-list {
  padding: 6px 4px;
}

.sidebar-nav.is-collapsed .nav-item {
  justify-content: center;
  padding: 8px 4px;
  gap: 0;
}

.sidebar-nav.is-collapsed .sidebar-bottom-dock {
  padding: 6px 4px;
}

.sidebar-nav.is-collapsed #sidebar-bottom-user-card {
  justify-content: center;
  padding: 4px;
}

[data-theme="light"] .sidebar-collapse-btn {
  background: #f1f5f9;
  color: #334155;
}

[data-theme="light"] .sidebar-collapse-btn:hover {
  background: #fee2e2;
  color: #991b1b;
}

.area-id-code {
  font-family: 'Courier Prime', monospace;
  font-size: 10.5px;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Panel de Control de Acceso Integrado en Pantalla de Inicio */
.dash-access-panel {
  background: var(--bg-card);
  border: 1.5px solid rgba(59, 130, 246, 0.35);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.dash-access-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-access-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d62828, #991b1b);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(214, 40, 40, 0.35);
}

.dash-access-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   SOPORTE COMPLETO DE TEMA CLARO ([data-theme="light"])
   ========================================================================== */
[data-theme="light"] .area-id-bar {
  background: #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .area-id-code {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .dashboard-header-banner {
  background: linear-gradient(135deg, #FFFFFF, #F0F9FF);
  border-color: #BAE6FD;
  color: #0F2942;
}
[data-theme="light"] #btn-dash-dossier-biblia {
  background: #FEF3C7 !important;
  color: #92400E !important;
  border-color: #D97706 !important;
}
[data-theme="light"] .cs-redmouse-credit {
  color: #B91C1C !important;
}
[data-theme="light"] #cs-sec1-projects-history-packages > div:first-child strong {
  color: #0F2942 !important;
}

[data-theme="light"] .dashboard-title {
  color: #0f172a;
}

[data-theme="light"] .dashboard-sub-meta {
  color: #475569;
}

[data-theme="light"] .dash-kpi-card,
[data-theme="light"] .dash-module-card,
[data-theme="light"] .dash-access-panel,
[data-theme="light"] .dashboard-corporate-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .dash-kpi-val,
[data-theme="light"] .dash-mod-title,
[data-theme="light"] .dash-section-title,
[data-theme="light"] .dashboard-corporate-card strong {
  color: #0f172a !important;
}

[data-theme="light"] .dash-kpi-label,
[data-theme="light"] .dash-kpi-hint,
[data-theme="light"] .dash-mod-desc,
[data-theme="light"] .dashboard-corporate-card div {
  color: #475569 !important;
}

[data-theme="light"] .dash-mod-footer {
  border-top-color: #e2e8f0;
}

[data-theme="light"] .topbar-company-badge {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Auditoría integral de contraste Dark / Light + Estilos Suite Pro (Final Draft & Celtx) */
[data-theme="light"] .topbar {
  background: #FFFFFF;
  border-bottom-color: #0088CC;
  color: #0F2942;
}

[data-theme="light"] .topbar-row-utility {
  border-top-color: #E2E8F0;
}

[data-theme="light"] .topbar-company-title {
  color: #0F2942 !important;
}

[data-theme="light"] .topbar-company-title strong {
  color: #005596 !important;
}

[data-theme="light"] .topbar-company-sub {
  color: #0369A1 !important;
}

[data-theme="light"] .topbar-company-details,
[data-theme="light"] .topbar-company-details strong {
  color: #334155 !important;
}

[data-theme="light"] #project-type-select {
  background: #F0F9FF !important;
  color: #0F2942 !important;
  border-color: #BAE6FD !important;
}

[data-theme="light"] #project-type-select option,
[data-theme="light"] .form-select option {
  background: #ffffff;
  color: #0f172a;
}

[data-theme="light"] #btn-topbar-budgets,
[data-theme="light"] .workflow-ribbon a[href*="drive.google.com"] {
  background: #fef3c7 !important;
  color: #78350f !important;
  border-color: #d97706 !important;
}

[data-theme="light"] .workflow-ribbon {
  background: linear-gradient(90deg, #f8fafc 0%, #e2e8f0 50%, #f8fafc 100%);
  border-bottom-color: #cbd5e1;
}

[data-theme="light"] .wf-step {
  background: #ffffff;
  color: #1e293b !important;
  border-color: #cbd5e1;
}

[data-theme="light"] .wf-step:hover {
  background: #e2e8f0;
  color: #0f172a !important;
}

[data-theme="light"] .wf-step.active {
  background: #b91c1c !important;
  color: #ffffff !important;
  border-color: #991b1b !important;
}

[data-theme="light"] .wf-step-num {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .wf-step.active .wf-step-num {
  background: #ffffff;
  color: #991b1b;
}

[data-theme="light"] .project-health-pill {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .health-bar-track {
  background: #e2e8f0;
}

[data-theme="light"] .sidebar-nav {
  background: #f8fafc;
  border-right-color: #cbd5e1;
}

[data-theme="light"] .sidebar-brand-footer,
[data-theme="light"] .sidebar-bottom-dock {
  background: #f1f5f9;
  border-top-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .sidebar-group-details summary {
  color: #1e293b;
}

[data-theme="light"] .nav-item {
  color: #1e293b;
}

[data-theme="light"] .nav-item:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .nav-item.active {
  background: #E0F2FE;
  color: #005596;
  border-left-color: #0088CC;
}

[data-theme="light"] .nav-badge {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] #sidebar-bottom-user-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] #sidebar-bottom-user-card *,
[data-theme="light"] .sidebar-brand-footer * {
  color: #0f172a !important;
}

[data-theme="light"] .module-header,
[data-theme="light"] .script-subtools-bar,
[data-theme="light"] .script-formatting-toolbar,
[data-theme="light"] .shortcut-hint-bar,
[data-theme="light"] .breakdown-controls,
[data-theme="light"] .modal-card,
[data-theme="light"] .modal-header,
[data-theme="light"] .modal-footer {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] .btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] .btn-secondary:hover {
  background: #f1f5f9;
}

[data-theme="light"] .btn-ghost {
  color: #1e293b;
}

[data-theme="light"] .save-badge {
  color: #047857 !important;
  font-weight: 700;
}

[data-theme="light"] .stats-pill {
  color: #b45309 !important;
}

[data-theme="light"] .index-card,
[data-theme="light"] .bible-card,
[data-theme="light"] .budget-kpi-card {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] .index-card-top {
  color: #ffffff;
}

/* Suite Pro (Final Draft + Celtx): Paneles adaptables Claro/Oscuro */
.cs-pro-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text-main);
}

.cs-pro-muted {
  color: var(--text-muted);
}

.cs-pro-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-main);
}

.cs-pro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cs-pro-table th,
.cs-pro-table td {
  border: 1px solid var(--border-color);
  padding: 7px 9px;
  text-align: left;
  color: var(--text-main);
  vertical-align: top;
}

.cs-pro-table th {
  background: var(--bg-panel);
  font-weight: 800;
}

.cs-pro-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--bg-panel);
  color: var(--text-main);
}

.cs-pro-alert-ok {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #10b981;
  background: rgba(16, 185, 129, 0.12);
  color: var(--text-main);
  font-size: 12px;
}

.cs-story-map-track {
  position: relative;
  height: 36px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.cs-story-map-node {
  position: absolute;
  top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1.5px solid #d62828;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cs-story-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cs-beat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.cs-beat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  color: var(--text-main);
}

.cs-pro-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.cs-pro-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cs-pro-kpi span {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.cs-pro-kpi strong {
  font-size: 16px;
  color: var(--text-main);
}

.cs-pro-diff-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-main);
}

.cs-diff-del {
  background: rgba(239, 68, 68, 0.22);
  color: #dc2626;
  padding: 0 3px;
  border-radius: 3px;
  text-decoration: line-through;
}

.cs-diff-ins {
  background: rgba(16, 185, 129, 0.22);
  color: #059669;
  padding: 0 3px;
  border-radius: 3px;
  text-decoration: underline;
  font-weight: 700;
}

[data-theme="dark"] .cs-diff-del { color: #fca5a5; }
[data-theme="dark"] .cs-diff-ins { color: #6ee7b7; }

.cs-pro-page-break {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px dashed #dc2626;
  margin: 14px 0;
  padding-top: 3px;
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  font-weight: 800;
  color: #b91c1c;
}

.cs-pro-cont-label {
  text-align: center;
  font-family: 'Courier Prime', monospace;
  font-size: 10.5pt;
  font-weight: 700;
  color: #334155;
  margin-bottom: 2px;
}

.cs-pro-inline-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
  padding-left: 12px;
}

.cs-pro-chip-lock,
.cs-pro-chip-alt,
.cs-pro-chip-tag {
  font-family: sans-serif;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  cursor: pointer;
}

.cs-pro-chip-lock {
  border-color: #d97706;
  background: #fef3c7;
  color: #78350f;
}

.cs-pro-chip-alt {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1e40af;
}

/* Hoja de guion con texto negro en ambos temas y fondo reactivo al color de revisión oficial */
#script-paper,
.script-page {
  background: #ffffff;
  color: #000000 !important;
  transition: background-color 0.25s ease;
}

#script-paper[data-revision="white"],
.script-page[data-revision="white"] {
  background: #ffffff !important;
}

#script-paper[data-revision="blue"],
.script-page[data-revision="blue"] {
  background: #dbeafe !important; /* Azul oficial de revisión */
}

#script-paper[data-revision="pink"],
.script-page[data-revision="pink"] {
  background: #fce7f3 !important; /* Rosa oficial de revisión */
}

#script-paper[data-revision="yellow"],
.script-page[data-revision="yellow"] {
  background: #fef9c3 !important; /* Amarillo oficial de revisión */
}

#script-paper[data-revision="green"],
.script-page[data-revision="green"] {
  background: #dcfce7 !important; /* Verde oficial de revisión */
}

#script-paper[data-revision="goldenrod"],
#script-paper[data-revision="gold"],
.script-page[data-revision="goldenrod"],
.script-page[data-revision="gold"] {
  background: #fef08a !important; /* Dorado oficial de revisión final */
}

/* Resalte de bloques modificados en revisión */
.script-block.revised,
.script-block[data-revised="true"],
.script-block-wrapper.is-revised .script-block {
  border-left: 3.5px solid #2563eb;
  padding-left: 6px;
  background-color: rgba(37, 99, 235, 0.08);
}

/* ==========================================================================
   SLIDERS SIEMPRE QUE SEA NECESARIO Y EN COLOR ROJO CORPORATIVO
   ========================================================================== */
.view-section.active {
  overflow-y: auto;
  overflow-x: auto;
}

#view-script.active {
  overflow: hidden;
}

.script-scroll-container,
.sidebar,
.breakdown-content,
.corkboard-grid,
.bible-layout,
.schedule-workspace,
.stats-dashboard,
.tester-table-wrap,
.modal-body {
  overflow-y: auto;
}

/* Firefox */
* {
  scrollbar-color: #d62828 rgba(148, 163, 184, 0.2);
  scrollbar-width: auto;
}

/* Chrome / Edge / WebKit */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.22);
  border-radius: 6px;
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: rgba(203, 213, 225, 0.55);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f87171, #dc2626);
  border: 1px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Sliders de rango (<input type="range">) en color rojo */
input[type="range"],
.form-range {
  accent-color: #d62828;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(214, 40, 40, 0.28);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d62828;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  margin-top: -5px;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(214, 40, 40, 0.28);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d62828;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* Sección 2: Asteriscos de revisión en margen derecho */
.script-block[data-rev-star] {
  position: relative;
}
.script-block[data-rev-star]::after {
  content: attr(data-rev-star);
  position: absolute;
  right: -24px;
  top: 0;
  color: #d62828;
  font-weight: 900;
}
.sec2-ac-item:hover {
  background: #d62828;
}

/* ============================================================================
   PANTALLA DE ACCESO CIFRADA 256-BIT (#cs-login-gate) Y PERFIL SUPERIOR DERECHO
   ============================================================================ */
body:not(.cs-authenticated) .topbar,
body:not(.cs-authenticated) .workflow-ribbon,
body:not(.cs-authenticated) .app-layout,
body:not(.cs-authenticated) #forensic-watermark,
body:not(.cs-authenticated) .app-footer {
  display: none !important;
}

.cs-login-gate {
  position: fixed;
  inset: 0;
  z-index: 150000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 15%, rgba(214, 40, 40, 0.24), transparent 46%),
    radial-gradient(circle at 82% 85%, rgba(214, 40, 40, 0.16), transparent 50%),
    linear-gradient(135deg, #06080e 0%, #0f172a 55%, #090c14 100%);
}

.cs-login-backdrop-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.cs-login-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid rgba(214, 40, 40, 0.72);
  border-radius: 18px;
  padding: 28px 30px 22px 30px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(16px);
  color: #f8fafc;
}

.cs-login-brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cs-login-logo-box {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #ffffff;
  padding: 3px;
  border: 1.5px solid #0095d9;
  box-shadow: 0 4px 12px rgba(0, 149, 217, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-login-logo-img {
  width: 100%;
  height: 100%;
  max-width: 50px;
  max-height: 50px;
  object-fit: contain;
  display: block;
}

.cs-login-card[data-brand-area="admin"] .cs-login-logo-box {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  max-width: 50px;
  max-height: 50px;
  border-color: #d62828;
  box-shadow: 0 4px 12px rgba(214, 40, 40, 0.35);
}

.cs-login-company-info {
  min-width: 0;
  flex: 1;
}

.cs-login-company-name {
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.cs-login-legal-name {
  font-size: 11px;
  font-weight: 700;
  color: #fca5a5;
  margin-top: 2px;
}

.cs-login-contact-line {
  font-size: 11px;
  color: #cbd5e1;
  margin-top: 3px;
  line-height: 1.35;
}

.cs-login-crypto-ribbon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px 0;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 11px;
  color: #a7f3d0;
  font-weight: 700;
}

.cs-login-title {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
}

.cs-login-subtitle {
  margin: 0 0 14px 0;
  font-size: 12.5px;
  color: #94a3b8;
}

.cs-login-alert {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid #ef4444;
  color: #fecaca;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.cs-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cs-login-field label {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
}

.cs-login-field .form-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 13.5px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #ffffff;
  border-radius: 9px;
}

.cs-login-field .form-input:focus {
  border-color: #d62828;
  box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.25);
  outline: none;
}

.cs-login-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cs-login-pass-wrap .form-input {
  padding-right: 40px;
}

.cs-login-eye-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
}

.cs-login-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
}

.cs-login-remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  cursor: pointer;
}

.cs-login-link-btn {
  background: transparent;
  border: none;
  color: #fca5a5;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.cs-login-link-btn:hover {
  color: #ffffff;
}

.cs-login-submit-btn {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #d62828, #991b1b);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(214, 40, 40, 0.42);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.cs-login-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(214, 40, 40, 0.56);
}

.cs-login-submit-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.cs-login-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.5;
}

/* PERFIL DE USUARIO + DESPLEGABLE EN LA ESQUINA SUPERIOR DERECHA */
.cs-user-profile-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  z-index: 220;
}

.cs-user-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(214, 40, 40, 0.18), rgba(15, 23, 42, 0.94));
  border: 1.5px solid #d62828;
  border-radius: 999px;
  padding: 3px 12px 3px 4px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(214, 40, 40, 0.25);
  transition: all 0.15s ease;
}

.cs-user-pill-btn:hover {
  border-color: #ef4444;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(214, 40, 40, 0.42);
}

.cs-user-avatar-box {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #ef4444;
  background: #ffffff;
  overflow: visible;
  flex-shrink: 0;
}

.cs-user-avatar-box img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.cs-user-online-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0f172a;
  box-shadow: 0 0 6px #22c55e;
}

.cs-user-pill-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.cs-user-pill-meta strong {
  font-size: 12px;
  color: #ffffff;
  font-weight: 800;
  max-width: 145px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-user-pill-meta span {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.cs-user-chevron {
  font-size: 11px;
  color: #cbd5e1;
  margin-left: 2px;
}

.cs-user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 256px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: #0f172a;
  border: 1.5px solid #d62828;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.72);
  z-index: 95000;
  color: #f8fafc;
}

.cs-ud-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(214, 40, 40, 0.2), rgba(30, 41, 59, 0.92));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cs-ud-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d62828;
  background: #ffffff;
  flex-shrink: 0;
}

.cs-ud-name {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-ud-role {
  font-size: 10.5px;
  font-weight: 800;
  margin-top: 1px;
}

.cs-ud-sub {
  font-size: 10px;
  color: #cbd5e1;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-ud-crypto-tag {
  display: inline-block;
  margin-top: 3px;
  font-size: 9.5px;
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  padding: 2px 6px;
  border-radius: 999px;
}

.cs-ud-menu-list {
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cs-ud-menu-list hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 3px 6px;
}

.cs-ud-menu-list button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.cs-ud-menu-list button small {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
}

.cs-ud-menu-list button:hover {
  background: rgba(214, 40, 40, 0.22);
  color: #ffffff;
}

.cs-ud-logout-btn {
  color: #fca5a5 !important;
}

.cs-ud-logout-btn:hover {
  background: rgba(239, 68, 68, 0.28) !important;
}

[data-theme="light"] .cs-user-pill-btn {
  background: #ffffff;
  border-color: #d62828;
}

[data-theme="light"] .cs-user-pill-meta strong {
  color: #0f172a;
}

[data-theme="light"] .cs-user-dropdown {
  background: #ffffff;
  color: #0f172a;
}

[data-theme="light"] .cs-ud-header {
  background: linear-gradient(135deg, #fff1f2, #f8fafc);
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .cs-ud-name {
  color: #0f172a;
}

[data-theme="light"] .cs-ud-sub {
  color: #475569;
}

[data-theme="light"] .cs-ud-menu-list button {
  color: #1e293b;
}

[data-theme="light"] .cs-ud-menu-list button:hover {
  background: #fee2e2;
  color: #991b1b;
}

[data-theme="light"] .cs-ud-menu-list hr {
  border-top-color: #e2e8f0;
}


/* ============================================================================
   TESTER MODAL DARK CONTRAST GUARD + RIGHT DRAWER & COMPACT WORKSPACE UI
   ============================================================================ */
.tester-modal-card .btn-secondary {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
}

.tester-modal-card .btn-secondary:hover {
  background: #334155 !important;
}

.script-compact-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cs-slim-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cs-slim-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.script-right-tools-drawer {
  width: 268px;
  min-width: 268px;
  background: var(--bg-panel);
  color: var(--text-main);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width 0.18s ease, min-width 0.18s ease;
  z-index: 4;
}

.script-right-tools-drawer.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  border-left-width: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.cs-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 2;
}

.cs-drawer-sections {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-drawer-group {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  overflow: hidden;
}

.cs-drawer-group summary {
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-main);
  background: var(--bg-elevated);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.cs-drawer-group summary::-webkit-details-marker {
  display: none;
}

.cs-drawer-group summary::after {
  content: '▾';
  font-size: 11px;
  opacity: 0.7;
}

.cs-drawer-group:not([open]) summary::after {
  content: '▸';
}

.cs-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 8px;
}

.cs-drawer-grid .el-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 5px 7px;
  font-size: 11px;
}

.cs-drawer-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.cs-drawer-stack .btn,
.cs-drawer-stack select {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  font-size: 11.5px;
}

.cs-compact-hint {
  position: relative;
  padding: 6px 28px 6px 10px !important;
  margin-bottom: 10px !important;
  font-size: 11px !important;
}

.cs-hint-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

.cs-compact-layout .module-header {
  padding: 10px 18px;
  margin-bottom: 10px;
}

[data-theme="light"] .script-right-tools-drawer,
[data-theme="light"] .script-compact-topbar {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] .cs-drawer-group {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .cs-drawer-group summary {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .cs-drawer-head {
  background: #ffffff;
  color: #0f172a;
}

/* ============================================================================
   ÁREA 03 PRESUPUESTOS — CENTRO EDITABLE + MENÚ DERECHO DESPLEGABLE + LIGHT MODE
   ============================================================================ */
.budget-workspace-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.budget-center-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.budget-center-column .breakdown-content {
  padding: 12px 18px 28px 18px;
}

.cs-budget-compact-metrics {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-main);
  flex-wrap: wrap;
}

.cs-drawer-mode-btn {
  padding: 7px 10px !important;
  font-size: 11.5px !important;
  line-height: 1.3 !important;
  border-radius: 7px !important;
  text-align: left !important;
  width: 100%;
  box-shadow: none !important;
}

.budget-inline-input {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 12px;
}

.budget-inline-input:focus {
  outline: none;
  border-color: #d62828;
  box-shadow: 0 0 0 2px rgba(214, 40, 40, 0.25);
}

[data-theme="light"] #budget-compact-topbar,
[data-theme="light"] #budget-right-tools-drawer {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] #view-budgets .budget-dept-header strong,
[data-theme="light"] #view-budgets .budget-dept-card h3,
[data-theme="light"] #view-budgets .budget-dept-card h4,
[data-theme="light"] #view-budgets #icaa-budget-workspace-content h3 {
  color: #0f172a !important;
}

[data-theme="light"] #view-budgets .budget-dept-header span[style*="#fbbf24"],
[data-theme="light"] #view-budgets .budget-table td[style*="#fbbf24"],
[data-theme="light"] #view-budgets .budget-table td[style*="#fde68a"] {
  color: #92400e !important;
}

[data-theme="light"] #view-budgets .budget-dept-card p[style*="#cbd5e1"],
[data-theme="light"] #view-budgets .budget-table td[style*="#cbd5e1"],
[data-theme="light"] #view-budgets [style*="color:#cbd5e1"] {
  color: #334155 !important;
}

[data-theme="light"] #view-budgets a[href*="drive.google.com"],
[data-theme="light"] #budget-right-tools-drawer a[href*="drive.google.com"] {
  background: #fef3c7 !important;
  color: #78350f !important;
  border-color: #d97706 !important;
}

[data-theme="light"] #budget-right-tools-drawer .cs-drawer-mode-btn:not(.is-active-budget-mode) {
  color: #0f172a !important;
  background: #f1f5f9 !important;
}

/* Ajustes finos de anchura compacta para tablas ICAA y panel derecho sin desborde horizontal */
#budget-right-tools-drawer,
#script-right-tools-drawer {
  width: 244px;
  min-width: 244px;
}

#view-budgets .budget-table th,
#view-budgets .budget-table td {
  padding: 6px 6px;
  font-size: 11.5px;
}

#view-budgets .budget-inline-input {
  padding: 3px 5px;
  font-size: 11.5px;
}

.topbar-row-utility .btn-sm,
.topbar-row-utility .btn {
  padding: 3px 7px;
  font-size: 11px;
}

.topbar-row-utility .topbar-user-auth-btn {
  padding: 3px 8px;
}

/* ============================================================================
   MENÚ SUPERIOR DE GRANDES ÁREAS + SUBMENÚ CONTEXTUAL DINÁMICO IZQUIERDO
   ============================================================================ */
.cs-top-areas-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  overflow-x: visible;
  padding: 2px 0;
}

.cs-top-area-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8.5px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background-color: #1c212e;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.cs-top-area-btn:hover {
  background-color: #3f1820;
  color: #ffffff;
  border-color: rgba(214, 40, 40, 0.65);
}

.cs-top-area-btn.active {
  background-color: #991b1b;
  background-image: linear-gradient(135deg, #d62828, #991b1b);
  color: #ffffff;
  border-color: #ff8787;
  box-shadow: 0 2px 10px rgba(214, 40, 40, 0.35);
}

#cs-btn-project-flow {
  background-color: #7c2d12;
  background-image: linear-gradient(135deg, #991b1b, #b45309);
  border: 1px solid #f59e0b;
  color: #fef3c7;
  font-weight: 800;
}

#cs-btn-project-flow:hover {
  background-color: #991b1b;
  background-image: linear-gradient(135deg, #b91c1c, #d97706);
  color: #ffffff;
}

.cs-context-ribbon {
  height: 32px;
  padding: 0 10px;
  justify-content: space-between;
  gap: 8px;
}

.cs-context-ribbon-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.cs-context-ribbon-left > button {
  flex-shrink: 0;
  white-space: nowrap;
}

.cs-context-ribbon-tools {
  flex-shrink: 0;
  white-space: nowrap;
}

.cs-context-ribbon-tools .view-context-toolbar {
  flex-wrap: nowrap !important;
  white-space: nowrap;
}

.cs-context-pill {
  font-size: 11px;
  color: #f8fafc;
  white-space: nowrap;
  flex-shrink: 0;
}

.cs-context-meta-text {
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 165px;
}

.cs-sidebar-area-header {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(214, 40, 40, 0.12);
  border: 1px solid rgba(214, 40, 40, 0.35);
}

.cs-sidebar-area-kicker {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.7px;
  color: #fca5a5;
  text-transform: uppercase;
}

.cs-sidebar-area-title {
  font-size: 12.5px;
  font-weight: 900;
  color: #f8fafc;
  margin-top: 2px;
}

.cs-sidebar-area-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.cs-meta-chip {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cs-sidebar-context-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav.is-collapsed .cs-sidebar-area-header {
  display: none;
}

[data-theme="light"] .cs-top-area-btn {
  background: #FFFFFF;
  color: #0F2942;
  border-color: #CBD5E1;
}

[data-theme="light"] .cs-top-area-btn:hover {
  background: #E0F2FE;
  color: #005596;
  border-color: #0088CC;
}

[data-theme="light"] .cs-top-area-btn.active {
  background-color: #005596;
  background-image: linear-gradient(135deg, #0088CC, #005596);
  color: #FFFFFF;
  border-color: #00447A;
}

[data-theme="light"] .cs-context-pill {
  color: #0F2942;
}

[data-theme="light"] .cs-context-meta-text {
  color: #475569;
}

[data-theme="light"] .cs-sidebar-area-header {
  background: #F0F9FF;
  border-color: #BAE6FD;
}

[data-theme="light"] .cs-sidebar-area-kicker {
  color: #0369A1;
}

[data-theme="light"] .cs-sidebar-area-title {
  color: #0F2942;
}

[data-theme="light"] .cs-meta-chip {
  background: #FFFFFF;
  color: #0F2942;
  border-color: #CBD5E1;
}

html[data-theme="light"] #cs-btn-project-flow,
[data-theme="light"] #cs-btn-project-flow {
  background-color: #0369A1 !important;
  background-image: linear-gradient(135deg, #0284C7, #0369A1) !important;
  color: #FFFFFF !important;
  border-color: #0369A1 !important;
}

html[data-theme="dark"] #cs-btn-project-flow {
  background-color: #991B1B !important;
  background-image: linear-gradient(135deg, #991B1B, #B45309) !important;
  color: #FFFFFF !important;
  border-color: #F59E0B !important;
}

.cs-sidebar-context-nav .nav-item {
  color: #cbd5e1;
  background: transparent;
}

.cs-sidebar-context-nav .nav-item:hover {
  background: #1e293b;
  color: #ffffff;
}

.cs-sidebar-context-nav .nav-item.active {
  background: #1e3a5f;
  color: #f8fafc;
  border-left: 3px solid #60a5fa;
}

[data-theme="light"] .cs-sidebar-context-nav .nav-item {
  color: #1e293b;
  background: transparent;
}

[data-theme="light"] .cs-sidebar-context-nav .nav-item:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .cs-sidebar-context-nav .nav-item.active {
  background: #dbeafe;
  color: #1e3a8a;
  border-left: 3px solid #2563eb;
}

/* ============================================================================
   SISTEMA UNIVERSAL DE ÁREA DESPEJADA + PANEL LATERAL DERECHO + MAXIMIZAR + TRAZABILIDAD
   ============================================================================ */
.cs-unified-compact-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 12px;
  min-height: 38px;
  background: #0f172a;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.cs-unified-topbar-left,
.cs-unified-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.cs-unified-view-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
}

.cs-trace-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(96, 165, 250, 0.35);
  flex-shrink: 0;
}

.cs-trace-step-btn {
  border: none;
  background: transparent;
  color: #93c5fd;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.cs-trace-step-btn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.25);
  color: #ffffff;
}

.cs-trace-step-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.cs-trace-badge {
  font-size: 10.5px;
  font-weight: 800;
  color: #fef3c7;
  background: rgba(214, 40, 40, 0.26);
  border: 1px solid rgba(251, 191, 36, 0.45);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.btn-cs-universal-max {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff !important;
  border: 1px solid #60a5fa !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

.btn-cs-universal-max.is-maximized {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  border-color: #fca5a5 !important;
}

.cs-unified-workspace-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  width: 100%;
}

.cs-unified-center-col {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.cs-unified-center-col > .breakdown-content,
.cs-unified-center-col > #breakdown-content,
.cs-unified-center-col > #distribution-container,
.cs-unified-center-col > #scriptlog-container,
.cs-unified-center-col > #dpr-container,
.cs-unified-center-col > #tax-incentives-container,
.cs-unified-center-col > #users-mgmt-container,
.cs-unified-center-col > #gdrive-workspace-content,
.cs-unified-center-col > #alerts-workspace-content,
.cs-unified-center-col > #stats-dashboard,
.cs-unified-center-col > #corkboard-grid {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.cs-unified-center-col .tableread-layout {
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

.cs-unified-right-drawer {
  width: 262px;
  min-width: 262px;
  max-width: 262px;
  background: #0f172a;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  transition: width 0.18s ease, min-width 0.18s ease, padding 0.18s ease, opacity 0.16s ease;
}

.cs-unified-right-drawer.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border-left: none !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none;
}

.cs-unified-right-drawer .cs-drawer-group-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-unified-right-drawer .cs-drawer-group-body .btn,
.cs-unified-right-drawer [id^="sec"] button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  line-height: 1.25;
}

.cs-unified-right-drawer .breakdown-controls,
.cs-unified-right-drawer .module-filters {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

.cs-unified-right-drawer .filter-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: none !important;
  margin-left: 0 !important;
  gap: 4px;
}

.cs-unified-right-drawer .filter-group select,
.cs-unified-right-drawer .filter-group input {
  width: 100% !important;
  min-width: 0 !important;
}

.cs-unified-right-drawer .breakdown-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: 0 !important;
}

.cs-unified-right-drawer .schedule-legend {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 5px !important;
  padding: 4px 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

.cs-unified-right-drawer .schedule-legend .strip-badge {
  font-size: 9.5px;
  text-align: center;
  padding: 4px 5px;
}

.cs-unified-right-drawer [id^="sec"] > div {
  margin: 0 !important;
  padding: 6px !important;
  border-radius: 8px !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
}

.cs-trace-drawer-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* MODO MAXIMIZADO UNIVERSAL EN TODAS LAS VISTAS */
body.cs-view-maximized .topbar,
body.cs-view-maximized .workflow-ribbon,
body.cs-view-maximized #cs-sidebar-nav,
body.cs-view-maximized .view-section .area-id-bar {
  display: none !important;
}

body.cs-view-maximized .app-layout {
  height: 100vh !important;
  max-height: 100vh !important;
}

body.cs-view-maximized .main-workspace {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
}

body.cs-view-maximized .view-section.active {
  height: 100vh !important;
  max-height: 100vh !important;
}

body.cs-view-maximized #cs-fullscreen-exit-fab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.cs-storyboard-fullscreen #cs-fullscreen-exit-fab {
  display: none !important;
}

[data-theme="light"] .cs-unified-compact-topbar {
  background: #f8fafc;
  border-bottom-color: #cbd5e1;
}

[data-theme="light"] .cs-unified-view-title {
  color: #0f172a;
}

[data-theme="light"] .cs-trace-nav {
  background: #ffffff;
  border-color: #93c5fd;
}

[data-theme="light"] .cs-trace-step-btn {
  color: #1d4ed8;
}

[data-theme="light"] .cs-trace-step-btn:hover:not(:disabled) {
  background: #dbeafe;
  color: #1e3a8a;
}

[data-theme="light"] .cs-trace-badge {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fca5a5;
}

[data-theme="light"] .cs-unified-right-drawer {
  background: #f8fafc;
  border-left-color: #cbd5e1;
}

[data-theme="light"] .cs-trace-drawer-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* ============================================================================
   PROCESO 2: GANTT INVERSO, CALENDARIO MULTIVISTA Y ESTRATEGIA MAREO/DAFO/CAPS
   ============================================================================ */
.pp-shell { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pp-topbar-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.pp-topbar-row1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pp-view-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pp-tab-btn { background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 7px; padding: 6px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.pp-tab-btn:hover { background: var(--bg-hover); }
.pp-tab-btn.active { background: #d62828; color: #ffffff; border-color: #f87171; }
.pp-progress-wrap { min-width: 260px; flex: 0 1 380px; display: flex; flex-direction: column; gap: 4px; }
.pp-progress-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; flex-wrap: wrap; }
.pp-progress-track { height: 7px; background: var(--bg-input); border-radius: 99px; overflow: hidden; border: 1px solid var(--border-color); }
.pp-progress-fill { height: 100%; background: linear-gradient(90deg, #10b981, #3b82f6); border-radius: 99px; transition: width 0.25s; }
.pp-topbar-row2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-deadline-box { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; font-weight: 700; }
.pp-filter-pills { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pp-pill { background: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 99px; padding: 3px 9px; font-size: 10.5px; font-weight: 700; cursor: pointer; }
.pp-pill.active { background: var(--pp-pill-col, #3b82f6); color: #ffffff; border-color: transparent; }
.pp-inp-sm { padding: 3px 7px !important; font-size: 11.5px !important; min-height: 26px !important; }
.pp-ta { width: 100%; padding: 6px 8px; font-size: 11.5px; line-height: 1.35; }
.pp-lbl { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); margin: 6px 0 3px 0; }
.pp-alert-banner { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: rgba(239, 68, 68, 0.14); border: 1px solid #ef4444; color: #fecaca; padding: 6px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 700; }

.pp-main-split { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 12px; align-items: start; min-width: 0; }
@media (max-width: 1160px) { .pp-main-split { grid-template-columns: minmax(0, 1fr); } }
.pp-center-canvas { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pp-inspector-aside { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pp-insp-head { border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.pp-insp-block { border-bottom: 1px dashed var(--border-color); padding-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.pp-insp-block:last-child { border-bottom: none; padding-bottom: 0; }
.pp-insp-block label { font-size: 11px; font-weight: 800; color: var(--text-muted); }
.pp-insp-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pp-subtasks { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.pp-subtask-item { display: flex; gap: 6px; align-items: center; font-size: 11.5px !important; font-weight: 500 !important; color: var(--text-main) !important; cursor: pointer; }
.pp-subtask-item span.done { text-decoration: line-through; opacity: 0.65; }
.pp-alerts-feed { display: flex; flex-direction: column; gap: 5px; max-height: 170px; overflow-y: auto; }
.pp-feed-item { font-size: 11px; padding: 5px 7px; border-radius: 6px; border-left: 3px solid #3b82f6; background: var(--bg-surface); }
.pp-feed-item.sev-critical { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.14); }
.pp-feed-item.sev-warning, .pp-feed-item.sev-amber { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.14); }
.pp-feed-item.sev-ok { border-left-color: #10b981; background: rgba(16, 185, 129, 0.14); }

.pp-calc-strip, .pp-legend-strip { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 11px; }
.pp-legend-strip { justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border-color); padding: 6px 10px; border-radius: 8px; }
.pp-calc-chip { background: var(--bg-card); border: 1px solid var(--border-color); padding: 4px 8px; border-radius: 7px; font-size: 11px; }
.pp-calc-chip.warn { border-color: #f59e0b; background: rgba(245, 158, 11, 0.14); }
.pp-calc-chip.danger { border-color: #ef4444; background: rgba(239, 68, 68, 0.16); }
.pp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }

.pp-gantt-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.pp-gantt-head { display: grid; grid-template-columns: 270px minmax(0, 1fr); background: var(--bg-surface); border-bottom: 1px solid var(--border-color); font-size: 10.5px; font-weight: 800; }
.pp-gantt-head-label { padding: 7px 10px; border-right: 1px solid var(--border-color); }
.pp-gantt-head-scale { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.pp-gantt-tick { font-size: 10px; color: var(--text-muted); padding: 6px 2px; }
.pp-gantt-body-rel { position: relative; max-height: 430px; overflow-y: auto; }
.pp-gantt-svg { position: absolute; left: 270px; top: 0; width: calc(100% - 270px); pointer-events: none; z-index: 1; }
.pp-gantt-rows { position: relative; z-index: 2; }
.pp-gantt-row { display: grid; grid-template-columns: 270px minmax(0, 1fr); height: 34px; border-bottom: 1px solid var(--border-color); cursor: pointer; align-items: center; }
.pp-gantt-row:hover { background: var(--bg-hover); }
.pp-gantt-row.selected { background: rgba(59, 130, 246, 0.15); }
.pp-gantt-row.dimmed { opacity: 0.25; }
.pp-gantt-row-label { display: flex; gap: 6px; align-items: center; padding: 0 8px; border-right: 1px solid var(--border-color); height: 100%; overflow: hidden; font-size: 11px; }
.pp-id-tag { font-weight: 800; font-size: 10px; color: #93c5fd; flex-shrink: 0; }
.pp-row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-gantt-track { position: relative; height: 100%; }
.pp-gantt-bar { position: absolute; top: 5px; height: 24px; border-radius: 5px; display: flex; align-items: center; gap: 4px; padding: 0 6px; color: #ffffff; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.35); cursor: grab; }
.pp-diamond { color: #fde047; font-size: 12px; flex-shrink: 0; text-shadow: 0 0 6px rgba(250, 204, 21, 0.9); }
@keyframes ppBlockedPulse { 0%, 100% { box-shadow: 0 0 0 1px #ef4444, 0 0 8px rgba(239,68,68,0.75); } 50% { box-shadow: 0 0 0 2px #fca5a5, 0 0 14px rgba(239,68,68,0.95); } }
.pp-gantt-bar.is-blocked-pulse { animation: ppBlockedPulse 1.2s infinite; }

.pp-master-table-wrap { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 10px; }
.pp-subhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; font-weight: 800; }
.pp-table-scroll { max-height: 290px; overflow: auto; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.pp-table th, .pp-table td { border-bottom: 1px solid var(--border-color); padding: 5px 6px; text-align: left; }
.pp-table th { position: sticky; top: 0; background: var(--bg-surface); font-size: 10.5px; z-index: 2; }
.pp-table tr { cursor: pointer; }
.pp-table tr.selected { background: rgba(59, 130, 246, 0.16); }
.pp-dept-chip { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.pp-st-pill { display: inline-block; padding: 2px 7px; border-radius: 99px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.pp-cell-date { background: transparent; border: 1px solid var(--border-color); border-radius: 4px; color: var(--text-main); font-size: 10.5px; padding: 1px 4px; }

.pp-month-header { display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); border: 1px solid var(--border-color); padding: 8px 12px; border-radius: 10px; }
.pp-cal-grid-hdr { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; font-size: 11px; font-weight: 800; color: var(--text-muted); }
.pp-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.pp-cal-cell { min-height: 82px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.pp-cal-cell.empty { opacity: 0.3; }
.pp-cal-cell.has-milestone { border-color: #f59e0b; box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.45); }
.pp-cal-daynum { font-size: 11px; font-weight: 800; color: var(--text-muted); }
.pp-cal-ms { background: rgba(245, 158, 11, 0.25); border: 1px solid #f59e0b; color: #fde68a; border-radius: 4px; padding: 2px 4px; font-size: 9.5px; font-weight: 800; cursor: pointer; text-align: left; }
.pp-cal-span { color: #ffffff; font-size: 9.5px; padding: 1px 4px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

.pp-wk-hdr, .pp-wk-lane { display: grid; grid-template-columns: 150px repeat(7, minmax(0, 1fr)); gap: 4px; }
.pp-wk-hdr > div { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; padding: 5px; text-align: center; font-size: 11px; font-weight: 800; }
.pp-wk-body { display: flex; flex-direction: column; gap: 4px; }
.pp-wk-dept { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; padding: 6px; display: flex; flex-direction: column; justify-content: center; font-size: 11px; }
.pp-wk-cell { min-height: 54px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.pp-wk-cell.overload { border-color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.pp-wk-warn { font-size: 9.5px; color: #fca5a5; font-weight: 800; }
.pp-wk-chip { width: 100%; text-align: left; padding: 3px 5px; border-radius: 4px; border: none; color: var(--text-main); font-size: 10px; cursor: pointer; }

.pp-daily-sheet { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pp-daily-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.pp-daily-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 900px) { .pp-daily-grid { grid-template-columns: 1fr; } }
.pp-daily-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; padding: 10px; font-size: 12px; }
.pp-daily-card h4 { margin: 0 0 6px 0; font-size: 13px; color: #93c5fd; }
.pp-crew-list, .pp-seq-list { display: flex; flex-direction: column; gap: 5px; }
.pp-seq-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 8px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; font-size: 11.5px; }

.pp-strategy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 980px) { .pp-strategy-grid { grid-template-columns: 1fr; } }
.pp-col-span-2 { grid-column: 1 / -1; }
.pp-strat-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.pp-strat-card h4 { margin: 0 0 4px 0; font-size: 13.5px; }
.pp-stages-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 1100px) { .pp-stages-row { grid-template-columns: 1fr 1fr; } }
.pp-stage-btn { text-align: left; padding: 8px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); cursor: pointer; display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; }
.pp-stage-btn.active { border-color: #d62828; background: rgba(214, 40, 40, 0.16); }
.pp-dafo-quad { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp-dafo-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.pp-dafo-head { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; }
.pp-dafo-item { display: flex; gap: 4px; align-items: center; }
.pp-fc-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11.5px; padding: 4px 0; border-bottom: 1px dashed var(--border-color); }
.pp-caps-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.pp-caps-pill { border: 1px solid; border-radius: 99px; padding: 2px 8px; font-size: 10.5px; font-weight: 700; }
.pp-caps-list, .pp-chg-list { display: flex; flex-direction: column; gap: 6px; }
.pp-caps-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--bg-surface); border: 1px solid var(--border-color); padding: 6px 8px; border-radius: 7px; font-size: 11.5px; }
.pp-caps-friction { background: rgba(245, 158, 11, 0.14); border: 1px solid #f59e0b; border-radius: 8px; padding: 8px; font-size: 11px; margin-top: 4px; }
.pp-caps-friction ul { margin: 4px 0 0 16px; }
.pp-chg-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px; font-size: 11.5px; }

[data-theme="light"] .pp-alert-banner { color: #991b1b; }
[data-theme="light"] .pp-id-tag { color: #1d4ed8; }
[data-theme="light"] .pp-cal-ms { color: #92400e; }
[data-theme="light"] .pp-wk-warn { color: #b91c1c; }
[data-theme="light"] .pp-daily-card h4 { color: #1d4ed8; }

/* Alto contraste inmediato en #btn-theme-toggle (evita transición diferida durante cambios de tema / Test 28 WCAG AA) */
#btn-theme-toggle {
  transition: none;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
[data-theme="light"] #btn-theme-toggle {
  transition: none;
  background: #ffffff;
  color: #0f172a !important;
  border-color: #cbd5e1;
}

/* ============================================================================
   CALENDARIO UNIFICADO DE RODAJE 03 (.rcal-*) — DARK & LIGHT WCAG AA
   ============================================================================ */
#rodaje-unified-calendar-slot,
.rcal-shell,
.rcal-unified-bar {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.rcal-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
}
.rcal-unified-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(135deg, rgba(214, 40, 40, 0.14), rgba(59, 130, 246, 0.10));
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
}
.rcal-unified-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}
.rcal-unified-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.rcal-pill-brand {
  background: #d62828;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.rcal-sr-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.rcal-day-select {
  width: auto;
  min-width: 180px;
  max-width: 310px;
  height: 28px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
}
.rcal-kpi-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.rcal-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.rcal-nav-active {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}
.rcal-substrip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-main);
  border-top: 1px dashed var(--border-color);
  padding-top: 7px;
}
.rcal-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}
.rcal-mode-group,
.rcal-period-nav,
.rcal-sync-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.rcal-period-label {
  font-size: 12.5px;
  font-weight: 800;
  min-width: 145px;
  text-align: center;
  color: var(--text-main);
}
.rcal-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}
.rcal-quick-months {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}
.rcal-qm-label {
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 2px;
}
.rcal-qm-pill {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.rcal-qm-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.rcal-qm-warn {
  color: #fbbf24;
  font-weight: 700;
  margin-left: auto;
}
.rcal-month-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.rcal-weekdays,
.rcal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}
.rcal-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 3px 0;
}
.rcal-cell {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-height: 92px;
  min-width: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease;
}
.rcal-cell.outside {
  opacity: 0.45;
}
.rcal-cell.today {
  border-color: #38bdf8;
}
.rcal-cell.selected {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.45);
}
.rcal-cell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rcal-cell-num {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-main);
}
.rcal-add-btn {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  line-height: 16px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}
.rcal-add-btn:hover {
  background: #d62828;
  color: #ffffff;
  border-color: #d62828;
}
.rcal-cell-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.rcal-day-chip {
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 6px;
  padding: 5px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rcal-day-chip.active {
  background: rgba(214, 40, 40, 0.22);
  border-color: #ef4444;
}
.rcal-day-chip.warn {
  border-left: 3px solid #f59e0b;
}
.rcal-chip-head {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #93c5fd;
  font-weight: 800;
}
.rcal-day-chip.active .rcal-chip-head {
  color: #fecaca;
}
.rcal-chip-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rcal-chip-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}
.rcal-chip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}
.rcal-mini-btn {
  background: var(--bg-panel);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  cursor: pointer;
}
.rcal-mini-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.rcal-pp-pill {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.rcal-pp-more {
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  padding-left: 2px;
}
.rcal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.rcal-week-col {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rcal-week-col.today {
  border-color: #38bdf8;
}
.rcal-week-col-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 5px;
  font-size: 11.5px;
}
.rcal-week-iso {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
}
.rcal-week-scenes {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.rcal-week-scene-item {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-size: 10px;
  padding: 3px 5px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  min-width: 0;
}
.rcal-sc-num {
  font-weight: 800;
  color: #93c5fd;
  white-space: nowrap;
}
.rcal-sc-slug {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.rcal-sc-len {
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.rcal-week-empty {
  font-size: 10.5px;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 1180px) {
  .rcal-month-grid,
  .rcal-week-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  }
  .rcal-weekdays {
    display: none;
  }
}

[data-theme="light"] .rcal-unified-bar {
  background: linear-gradient(135deg, rgba(214, 40, 40, 0.08), rgba(37, 99, 235, 0.08));
}
[data-theme="light"] .rcal-day-chip {
  background: #eff6ff;
  border-color: #93c5fd;
}
[data-theme="light"] .rcal-day-chip.active {
  background: #fef2f2;
  border-color: #dc2626;
}
[data-theme="light"] .rcal-chip-head,
[data-theme="light"] .rcal-sc-num {
  color: #1d4ed8;
}
[data-theme="light"] .rcal-day-chip.active .rcal-chip-head {
  color: #b91c1c;
}
[data-theme="light"] .rcal-pp-pill {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
[data-theme="light"] .rcal-qm-warn {
  color: #b45309;
}

/* ============================================================================
   CALENDARIO FINANCIERO 04: PAGOS, COBROS Y FISCAL (.fcal-*)
   ============================================================================ */
.fcal-shell,
.fcal-month-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.fcal-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
}
.fcal-brand-pill {
  background: #059669;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 5px;
}
.fcal-toolbar,
.fcal-period-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
}
.fcal-btn-group,
.fcal-quick-months {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.fcal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.fcal-month-title {
  font-size: 13.5px;
  min-width: 135px;
  text-align: center;
}
.fcal-qm-pill {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.fcal-qm-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.fcal-weekdays,
.fcal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}
.fcal-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 0;
}
.fcal-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-height: 104px;
  min-width: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fcal-cell.outside { opacity: 0.45; }
.fcal-cell.today { border-color: #38bdf8; box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35); }
.fcal-cell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.fcal-cell-num { font-size: 11.5px; font-weight: 800; }
.fcal-day-sum {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
}
.fcal-day-sum.in { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.fcal-day-sum.out { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.fcal-add-btn {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  line-height: 16px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}
.fcal-add-btn:hover { background: #059669; color: #ffffff; border-color: #059669; }
.fcal-cell-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fcal-ev-chip {
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 4px 5px;
  cursor: pointer;
  font-size: 10px;
  min-width: 0;
}
.fcal-ev-chip.income { background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.45); }
.fcal-ev-chip.payment { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.45); }
.fcal-ev-chip.obligation { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.45); }
.fcal-ev-chip.budget { background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.42); }
.fcal-ev-chip.done { opacity: 0.78; border-style: dashed; }
.fcal-ev-top {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
}
.fcal-ev-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}
.fcal-ev-more { font-size: 10px; color: var(--text-muted); cursor: pointer; font-weight: 700; }
.fcal-kind-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
.fcal-kind-pill.income { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.fcal-kind-pill.payment { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.fcal-kind-pill.obligation { background: rgba(245, 158, 11, 0.16); color: #fde68a; }
.fcal-kind-pill.budget { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }
.fcal-row-overdue { background: rgba(239, 68, 68, 0.05); }
.fcal-row-done { opacity: 0.8; }

@media (max-width: 1180px) {
  .fcal-month-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .fcal-weekdays { display: none; }
}

[data-theme="light"] .fcal-day-sum.in,
[data-theme="light"] .fcal-kind-pill.income { color: #047857; }
[data-theme="light"] .fcal-day-sum.out,
[data-theme="light"] .fcal-kind-pill.payment { color: #b91c1c; }
[data-theme="light"] .fcal-kind-pill.obligation { color: #92400e; }
[data-theme="light"] .fcal-kind-pill.budget { color: #1d4ed8; }

/* ============================================================================
   ESTÁNDAR CCOS v4.0 — BIBLIA SISTÉMICA DE PERSONAJES (6 BLOQUES / 18 CAMPOS)
   ============================================================================ */
.ccos-card-panel {
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ccos-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
}
.ccos-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.ccos-id-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.42);
}
.ccos-ver-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.ccos-status-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.ccos-status-pill.locked { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.42); }
.ccos-status-pill.review { background: rgba(245, 158, 11, 0.18); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.42); }
.ccos-status-pill.draft { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.35); }
.ccos-score-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}
.ccos-score-pill.ok { background: rgba(6, 182, 212, 0.18); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.4); }
.ccos-score-pill.warn { background: rgba(245, 158, 11, 0.22); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.5); }
.ccos-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ccos-blocks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 820px) {
  .ccos-blocks-grid { grid-template-columns: minmax(0, 1fr); }
}
.ccos-block-box {
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-left: 3px solid var(--ccos-accent, #3b82f6);
  border-radius: 7px;
  padding: 7px 9px;
  min-width: 0;
}
.ccos-block-title {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.45px;
  color: var(--text-main);
  margin-bottom: 5px;
  text-transform: uppercase;
}
.ccos-fields-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ccos-field-row {
  font-size: 11px;
  line-height: 1.38;
  word-break: break-word;
}
.ccos-field-lbl {
  font-weight: 800;
  color: #cbd5e1;
  font-size: 10.5px;
}
.ccos-field-val {
  color: var(--text-main);
  margin-left: 3px;
}
.ccos-field-val.empty { color: #f87171; font-style: italic; }

.ccos-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.84);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ccos-modal-sheet {
  background: var(--bg-panel);
  color: var(--text-main);
  border: 1.5px solid #ef4444;
  border-radius: 14px;
  width: min(1040px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.ccos-modal-header {
  padding: 14px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.ccos-modal-kicker {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #fca5a5;
}
.ccos-modal-header h3 { margin: 2px 0 0 0; font-size: 16px; }
.ccos-modal-toolbar {
  padding: 9px 18px;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ccos-modal-body {
  padding: 14px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ccos-ed-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid #3b82f6;
  border-radius: 9px;
  padding: 12px 14px;
}
.ccos-ed-block h4 {
  margin: 0 0 10px 0;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.4px;
}
.ccos-ed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
@media (max-width: 760px) {
  .ccos-ed-grid { grid-template-columns: minmax(0, 1fr); }
}
.ccos-ed-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ccos-ed-field.full { grid-column: 1 / -1; }
.ccos-ed-field label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
}
.ccos-hint {
  display: block;
  font-weight: 400;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 1px;
}
.ccos-modal-footer {
  padding: 12px 18px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Light Mode WCAG AA Contrast Overrides para CCOS v4.0 */
[data-theme="light"] .ccos-card-panel {
  background: #f8fafc;
  border-color: #cbd5e1;
}
[data-theme="light"] .ccos-block-box {
  background: #ffffff;
  border-color: #cbd5e1;
}
[data-theme="light"] .ccos-field-lbl { color: #334155; }
[data-theme="light"] .ccos-field-val { color: #0f172a; }
[data-theme="light"] .ccos-id-pill { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
[data-theme="light"] .ccos-ver-pill { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
[data-theme="light"] .ccos-status-pill.locked { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
[data-theme="light"] .ccos-status-pill.review { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
[data-theme="light"] .ccos-status-pill.draft { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
[data-theme="light"] .ccos-score-pill.ok { background: #cffafe; color: #155e75; border-color: #67e8f9; }
[data-theme="light"] .ccos-score-pill.warn { background: #fef3c7; color: #92400e; border-color: #fbbf24; }
[data-theme="light"] .ccos-modal-kicker { color: #b91c1c; }
[data-theme="light"] .ccos-modal-toolbar { background: #f1f5f9; }

/* ============================================================================
   PARTE DE SCRIPT DIGITAL CCOS v4.0 + DAVINCI RESOLVE 21 (.ss-*)
   ============================================================================ */
.ss-right-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ss-right-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 8px 9px;
}
.ss-right-title {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}
.ss-right-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ss-right-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.ss-right-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ss-right-nav-btn:hover { border-color: #ef4444; }
.ss-right-nav-btn.active {
  background: rgba(214, 40, 40, 0.22);
  border-color: #d62828;
  color: #ffffff;
}
.ss-nav-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-main);
}
.ss-audit-pill {
  margin-top: 7px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  border: 1px solid;
}
.ss-audit-pill.ok { background: rgba(16, 185, 129, 0.14); border-color: #10b981; color: #34d399; }
.ss-audit-pill.warn { background: rgba(245, 158, 11, 0.14); border-color: #f59e0b; color: #fbbf24; }
.ss-slate-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.ss-slate-clock {
  font-family: monospace;
  font-size: 14px;
  font-weight: 900;
  color: #f87171;
}
.ss-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ss-check-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-main);
  cursor: pointer;
}
.ss-workspace-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ss-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
}
.ss-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
}
.ss-kpi-lbl {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-muted);
}
.ss-kpi-val {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
  margin: 2px 0;
}
.ss-kpi-val.ok { color: #10b981; }
.ss-kpi-val.warn { color: #f59e0b; }
.ss-kpi-val .err { color: #ef4444; }
.ss-kpi-val.accent { color: #38bdf8; }
.ss-kpi-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}
.ss-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  padding: 14px;
}
.ss-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}
.ss-card-head h3 {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-main);
}
.ss-sub {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}
.ss-table-wrap { overflow-x: auto; }
.ss-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.ss-table th {
  padding: 9px 10px;
  text-align: left;
  font-size: 10.5px;
  background: rgba(214, 40, 40, 0.16);
  border-bottom: 1.5px solid #d62828;
  color: var(--text-main);
}
.ss-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  color: var(--text-main);
}
.ss-table tr.row-good { background: rgba(16, 185, 129, 0.06); }
.ss-table tr.row-crit { background: rgba(239, 68, 68, 0.08); }
.ss-strong-amber { font-weight: 800; color: #f59e0b; }
.ss-mono-dim { font-family: monospace; font-size: 10.5px; color: var(--text-muted); }
.ss-mono-tc { font-family: monospace; font-size: 11px; color: #38bdf8; font-weight: 700; }
.ss-crono-line { font-size: 11px; color: var(--text-main); margin-top: 2px; }
.ss-muted { font-size: 11px; color: var(--text-muted); }
.ss-note-snippet { font-size: 11px; color: var(--text-main); max-width: 280px; }
.ss-inline-status { font-size: 11px !important; font-weight: 800; padding: 4px 6px !important; min-width: 132px; }
.ss-chip {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid;
}
.ss-chip.ok { background: rgba(16, 185, 129, 0.15); border-color: #10b981; color: #34d399; }
.ss-chip.warn { background: rgba(245, 158, 11, 0.15); border-color: #f59e0b; color: #fbbf24; }
.ss-chip.err { background: rgba(239, 68, 68, 0.15); border-color: #ef4444; color: #f87171; }
.ss-prep-list, .ss-raccord-list, .ss-closing-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ss-prep-card {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 11px 12px;
}
.ss-prep-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.ss-prep-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 9px;
}
.ss-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.ss-check-pill.checked {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.14);
}
.ss-prep-inputs, .ss-raccord-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
@media (max-width: 860px) {
  .ss-prep-inputs, .ss-raccord-grid { grid-template-columns: minmax(0, 1fr); }
}
.ss-mini-lbl {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.ss-mini-input { width: 100%; font-size: 11.5px !important; padding: 5px 8px !important; }
.ss-mini-ta { width: 100%; height: 54px; font-size: 11.5px !important; padding: 6px 8px !important; }
.ss-photos-strip { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-color); }
.ss-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ss-photo-card { background: var(--bg-panel, #0f172a); border: 1px solid var(--border-color); border-radius: 8px; padding: 6px; }
.ss-photo-card img { width: 100%; height: 110px; object-fit: cover; border-radius: 5px; margin-bottom: 5px; }
.ss-crono-badge { padding: 6px 10px; border-radius: 7px; background: rgba(56, 189, 248, 0.15); border: 1px solid #38bdf8; color: #38bdf8; font-weight: 800; font-size: 12px; }
.ss-modal-body { display: flex; flex-direction: column; gap: 10px; }
.ss-modal-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ss-modal-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ss-modal-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 720px) {
  .ss-modal-grid2, .ss-modal-grid3, .ss-modal-grid4 { grid-template-columns: minmax(0, 1fr); }
}
.ss-print-only { display: none; }
@media print {
  .ss-print-only { display: block !important; }
}
[data-theme="light"] .ss-right-section { background: #f8fafc; border-color: #cbd5e1; }
[data-theme="light"] .ss-right-nav-btn { background: #ffffff; color: #0f172a; border-color: #cbd5e1; }
[data-theme="light"] .ss-right-nav-btn.active { background: #fee2e2; color: #991b1b; border-color: #dc2626; }
[data-theme="light"] .ss-prep-card { background: #f8fafc; border-color: #cbd5e1; }
[data-theme="light"] .ss-mono-tc { color: #0369a1; }
[data-theme="light"] .ss-strong-amber { color: #b45309; }
[data-theme="light"] .ss-chip.ok, [data-theme="light"] .ss-audit-pill.ok { color: #065f46; background: #d1fae5; }
[data-theme="light"] .ss-chip.warn, [data-theme="light"] .ss-audit-pill.warn { color: #92400e; background: #fef3c7; }
[data-theme="light"] .ss-chip.err { color: #991b1b; background: #fee2e2; }

/* ============================================================================
   CONTABILIDAD GENERAL PGC ESPAÑA (.acc-*)
   ============================================================================ */
.acc-shell { display: flex; flex-direction: column; gap: 12px; }
.acc-topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px;
}
.acc-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.acc-subtabs {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 6px;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px;
}
.acc-tab-btn {
  padding: 6px 11px; border-radius: 7px; border: 1px solid var(--border-color);
  background: transparent; color: var(--text-main); font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.acc-tab-btn:hover { border-color: #d62828; }
.acc-tab-btn.active {
  background: linear-gradient(135deg, #d62828, #b91c1c); border-color: #ff8787; color: #ffffff;
}
.acc-kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); gap: 10px;
}
.acc-kpi {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px;
}
.acc-kpi-lbl { font-size: 10.5px; font-weight: 800; color: var(--text-muted); }
.acc-kpi-val { font-size: 20px; font-weight: 900; color: var(--text-main); margin: 2px 0; }
.acc-kpi-val.ok { color: #10b981; }
.acc-kpi-val.warn { color: #f59e0b; }
.acc-kpi-val.accent { color: #38bdf8; }
.acc-kpi-sub { font-size: 10.5px; color: var(--text-muted); }
.acc-card {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 13px 14px;
}
.acc-card h3 { margin: 0; font-size: 14px; color: var(--text-main); }
.acc-card-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color);
}
.acc-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.acc-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.acc-form-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.acc-form-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.acc-modal-line-row { display: grid; grid-template-columns: 1.5fr 1.6fr 0.8fr 0.8fr 32px; gap: 6px; margin-bottom: 6px; align-items: center; }
@media (max-width: 860px) {
  .acc-grid2, .acc-template-grid, .acc-form-grid2, .acc-form-grid3, .acc-modal-line-row { grid-template-columns: minmax(0, 1fr); }
}
.acc-lbl { display: block; font-size: 10.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 3px; }
.acc-inp { width: 100%; font-size: 11.5px !important; padding: 5px 8px !important; }
.acc-table-wrap { overflow-x: auto; }
.acc-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.acc-table th {
  padding: 8px 9px; text-align: left; font-size: 10.5px;
  background: rgba(214, 40, 40, 0.14); border-bottom: 1.5px solid #d62828; color: var(--text-main);
}
.acc-table td { padding: 8px 9px; border-bottom: 1px solid var(--border-color); color: var(--text-main); vertical-align: top; }
.acc-lines-mini { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.acc-chip {
  display: inline-block; padding: 2px 6px; border-radius: 5px; font-size: 10px; font-weight: 800;
  border: 1px solid var(--border-color); background: rgba(148, 163, 184, 0.14); color: var(--text-main);
}
.acc-chip.ok { background: rgba(16, 185, 129, 0.15); border-color: #10b981; color: #34d399; }
.acc-chip.warn { background: rgba(245, 158, 11, 0.15); border-color: #f59e0b; color: #fbbf24; }
.acc-chip.err { background: rgba(239, 68, 68, 0.15); border-color: #ef4444; color: #f87171; }
.acc-tax-box {
  background: rgba(15, 23, 42, 0.35); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px;
  display: flex; flex-direction: column; gap: 5px; font-size: 12px;
}
.acc-tax-box h4 { margin: 0 0 4px; font-size: 13px; color: #38bdf8; }
[data-theme="light"] .acc-tax-box { background: #f8fafc; border-color: #cbd5e1; }
[data-theme="light"] .acc-tax-box h4 { color: #0369a1; }
[data-theme="light"] .acc-chip.ok { background: #d1fae5; color: #065f46; }
[data-theme="light"] .acc-chip.warn { background: #fef3c7; color: #92400e; }
[data-theme="light"] .acc-tab-btn { background: #ffffff; color: #0f172a; border-color: #cbd5e1; }
[data-theme="light"] .acc-tab-btn.active { background: #d62828; color: #ffffff; }
.acc-charts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 1120px) { .acc-charts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .acc-charts-grid { grid-template-columns: minmax(0, 1fr); } }
.acc-chart-card {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.acc-chart-title { font-size: 13px; font-weight: 800; color: var(--text-main); margin: 0; }
.acc-chart-legend { display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.acc-legend-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 5px; cursor: pointer; }
.acc-legend-row:hover { background: rgba(148, 163, 184, 0.14); }
.acc-legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 99px; margin-right: 6px; flex-shrink: 0; }
.acc-svg-label { fill: var(--text-muted); font-size: 10px; font-family: inherit; }
.acc-svg-val { fill: var(--text-main); font-size: 10.5px; font-weight: 800; font-family: inherit; }

/* Menú vertical a la izquierda dentro de Contabilidad General (PGC) */
.acc-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.acc-left-menu {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 8px;
}
.acc-left-group-lbl {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 8px 3px;
  margin-top: 4px;
  border-top: 1px solid var(--border-color);
}
.acc-left-group-lbl:first-child { margin-top: 0; border-top: none; padding-top: 2px; }
.acc-left-menu .acc-tab-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  text-align: left;
  padding: 7px 9px;
  font-size: 11.5px;
  line-height: 1.25;
}
.acc-left-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-main);
  flex-shrink: 0;
}
.acc-tab-btn.active .acc-left-badge { background: rgba(255, 255, 255, 0.24); color: #ffffff; }
.acc-left-badge.warn { background: rgba(245, 158, 11, 0.22); color: #fbbf24; }
.acc-left-badge.err { background: rgba(239, 68, 68, 0.24); color: #f87171; }
[data-theme="light"] .acc-left-badge.warn { color: #92400e; }
[data-theme="light"] .acc-left-badge.err { color: #991b1b; }
.acc-main-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 980px) {
  .acc-layout { grid-template-columns: minmax(0, 1fr); }
  .acc-left-menu { position: static; flex-direction: row; flex-wrap: wrap; }
  .acc-left-group-lbl { display: none; }
  .acc-left-menu .acc-tab-btn { width: auto; }
}

/* Tooltips explicativos interactivos al pasar el ratón por conceptos contables */
.acc-has-tip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px dotted rgba(56, 189, 248, 0.7);
  cursor: help;
}
.acc-tip-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 900;
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  flex-shrink: 0;
  line-height: 1;
}
[data-theme="light"] .acc-tip-ico {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}
.acc-floating-tooltip {
  position: fixed;
  z-index: 120000;
  max-width: 340px;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  border: 1.5px solid #38bdf8;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
  font-size: 11.5px;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.acc-floating-tooltip.visible { opacity: 1; }
.acc-floating-tooltip-title {
  font-weight: 900;
  color: #38bdf8;
  margin-bottom: 4px;
  font-size: 12px;
}
.acc-floating-tooltip-meta {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 10.5px;
  color: #fde68a;
}
[data-theme="light"] .acc-floating-tooltip {
  background: #ffffff;
  color: #0f172a;
  border-color: #0284c7;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}
[data-theme="light"] .acc-floating-tooltip-title { color: #0369a1; }
[data-theme="light"] .acc-floating-tooltip-meta { color: #b45309; }

/* Alertas presupuestarias, Multi-divisa, Auditoría y Cashflow */
.acc-alert-list, .acc-audit-list { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.acc-alert-item {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 8px; border: 1px solid var(--border-color); font-size: 11.5px;
}
.acc-alert-item.err { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.5); }
.acc-alert-item.warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.5); }
.acc-alert-item.ok { background: rgba(16, 185, 129, 0.10); border-color: rgba(16, 185, 129, 0.45); }
.acc-currency-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-color);
  background: rgba(56, 189, 248, 0.06); font-size: 11.5px;
}
.acc-modal-line-row { grid-template-columns: 1.5fr 1.5fr 0.75fr 0.75fr 30px; }

/* ============================================================================
   INVENTARIO 3 CAPAS, REDLAB ESTUDIO COLOR & DCP, SHOT DESIGNER 2D
   ============================================================================ */
.inv-shell, .rl-studio-shell, .sd-studio-shell {
  display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 100%; min-width: 0;
}
.inv-kpi-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px;
}
.inv-kpi {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.inv-kpi .lbl { font-size: 10px; font-weight: 800; color: var(--text-muted); letter-spacing: 0.5px; }
.inv-kpi strong { font-size: 14px; color: var(--text-main); }
.inv-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.inv-tab-btn, .rl-disc-btn, .sd-tool-btn {
  padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border-color);
  background: var(--bg-card); color: var(--text-main); font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.inv-tab-btn.active, .rl-disc-btn.active, .sd-tool-btn.active {
  background: var(--accent, #d62828); color: #fff; border-color: var(--accent, #d62828);
}
.inv-toolbar-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inv-search { flex: 1; min-width: 220px; }
.inv-sel { width: auto; min-width: 165px; }
.inv-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.inv-item-card {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px;
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
.inv-card-top { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.inv-id-pill { font-family: monospace; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(214,40,40,0.16); color: #ef4444; }
.inv-photos-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.inv-photos-strip img { width: 100%; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-color); }
.inv-item-title { margin: 0; font-size: 13px; color: var(--text-main); }
.inv-item-meta { font-size: 11px; color: var(--text-muted); }
.inv-item-specs { margin: 0; font-size: 11.5px; color: var(--text-main); opacity: 0.9; line-height: 1.35; }
.inv-compat-row { display: flex; gap: 4px; flex-wrap: wrap; }
.inv-compat-chip { font-size: 10px; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border-color); background: rgba(59,130,246,0.1); }
.inv-card-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.inv-layer2-layout { display: grid; grid-template-columns: minmax(220px, 260px) 1fr; gap: 12px; align-items: start; }
.inv-cases-list { display: flex; flex-direction: column; gap: 6px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px; }
.inv-case-btn { border: 1px solid var(--border-color); background: transparent; color: var(--text-main); border-radius: 8px; padding: 8px; cursor: pointer; width: 100%; }
.inv-case-btn.active { border-color: var(--accent, #d62828); background: rgba(214,40,40,0.12); }
.inv-flatlay-panel { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; min-width: 0; overflow-x: auto; }
.inv-flatlay-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.inv-flatlay-banner { padding: 8px 10px; border-radius: 8px; background: rgba(59,130,246,0.10); border: 1px solid rgba(59,130,246,0.35); font-size: 11.5px; margin-bottom: 10px; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.inv-table th, .inv-table td { padding: 7px 8px; border-bottom: 1px solid var(--border-color); text-align: left; }
.inv-layer3-grid { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 12px; align-items: start; }
.inv-wizard-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; }
.inv-wizard-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inv-results-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.inv-res-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 11px; }
.inv-res-box h4 { margin: 0 0 6px 0; font-size: 13px; }
.inv-res-box ul { margin: 0; padding-left: 18px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.inv-res-own { border-left: 4px solid #10b981; }
.inv-res-rules { border-left: 4px solid #f59e0b; }
.inv-res-red { border-left: 4px solid #ef4444; background: rgba(239,68,68,0.06); }

/* REDLAB NEUTRAL GRADING ROOM #0F1013 / #16181D */
.rl-studio-shell {
  background: #0F1013; color: #F1F5F9; border: 1px solid #262932; border-radius: 12px; padding: 12px;
}
.rl-header-strip {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 8px; border-bottom: 1px solid #262932;
}
.rl-brand-badge { font-weight: 900; font-size: 13px; color: #fff; background: #d62828; padding: 4px 10px; border-radius: 999px; }
.rl-chain-badge { font-size: 11px; font-weight: 700; color: #fde68a; background: #16181D; border: 1px solid #303542; padding: 4px 10px; border-radius: 999px; }
.rl-archive-links { display: flex; gap: 5px; flex-wrap: wrap; }
.rl-archive-pill { font-size: 10.5px; color: #93c5fd; background: #16181D; border: 1px solid #2c313d; padding: 3px 8px; border-radius: 6px; text-decoration: none; }
.rl-filter-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rl-disc-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.rl-studio-shell .rl-disc-btn { background: #16181D; border-color: #2d313b; color: #e2e8f0; }
.rl-studio-shell .rl-disc-btn.active { background: #d62828; border-color: #d62828; color: #fff; }
.rl-search-group { display: flex; gap: 6px; flex: 1; max-width: 620px; min-width: 240px; flex-wrap: wrap; align-items: center; }
.rl-search-inp { background: #16181D !important; color: #f8fafc !important; border-color: #2d313b !important; min-width: 190px; }
.rl-main-split { display: grid; grid-template-columns: 1fr minmax(340px, 460px); gap: 12px; align-items: start; }
.rl-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-height: 920px; overflow-y: auto; padding-right: 4px; }
.rl-ref-card { background: #16181D; border: 1px solid #2b303a; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.rl-ref-card.selected { border-color: #f59e0b; box-shadow: 0 0 0 1px #f59e0b; }
.rl-ref-media { position: relative; cursor: pointer; }
.rl-ref-media img { width: 100%; height: 112px; object-fit: cover; display: block; }
.rl-disc-tag { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: rgba(15,16,19,0.82); color: #f8fafc; }
.rl-sel-tag { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: rgba(245,158,11,0.9); color: #111827; }
.rl-ref-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.rl-ref-title { font-weight: 800; font-size: 12px; color: #f8fafc; }
.rl-ref-sub { font-size: 10.5px; color: #94a3b8; }
.rl-poem-quote { margin: 2px 0; padding: 5px 8px; border-left: 2px solid #f59e0b; font-style: italic; font-size: 11px; color: #e2e8f0; background: rgba(255,255,255,0.03); }
.rl-swatch-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.rl-hex-chip { border: none; border-radius: 4px; height: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: monospace; font-size: 8.5px; font-weight: 800; color: #fff; }
.rl-lab-col { display: flex; flex-direction: column; gap: 10px; }
.rl-lab-box { background: #16181D; border: 1px solid #2b303a; border-radius: 10px; padding: 10px; }
.rl-lab-box h4 { color: #f8fafc; font-size: 12.5px; }
.rl-mixer-sliders { display: flex; flex-direction: column; gap: 5px; margin: 8px 0; }
.rl-mix-row { display: grid; grid-template-columns: 1fr 90px 36px; gap: 6px; align-items: center; font-size: 11px; color: #cbd5e1; }
.rl-master-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 6px; }
.rl-master-slot { display: flex; flex-direction: column; gap: 3px; }
.rl-master-chip { border: 1px solid rgba(255,255,255,0.2); border-radius: 5px; height: 28px; cursor: pointer; font-family: monospace; font-size: 9px; font-weight: 800; color: #fff; width: 100%; }
.rl-swatch-picker { width: 100%; height: 18px; border: 1px solid #2d313b; border-radius: 4px; background: #0f1013; padding: 0; cursor: pointer; }
.rl-preset-strip { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.rl-name-inp { width: 100%; font-size: 11.5px; background: #0f1013 !important; color: #f8fafc !important; border-color: #2d313b !important; }
.rl-split-controls { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; color: #cbd5e1; }
.rl-grade-subhead { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: #fde68a; border-top: 1px solid #262932; padding-top: 6px; margin-top: 2px; }
.rl-grade-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.rl-grade-slider { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: #cbd5e1; }
.rl-grade-slider-full { width: 100%; }
.rl-grade-slider-hdr { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.rl-grade-slider-hdr strong { font-family: monospace; font-size: 10.5px; color: #93c5fd; }
.rl-split-controls input[type="range"], .rl-lab-box input[type="range"] { width: 100%; accent-color: #f59e0b; cursor: pointer; }
.rl-cinema-frame { background: #020305; padding: 14px; border-radius: 10px; border: 2px solid #0f172a; box-shadow: inset 0 0 36px rgba(0,0,0,0.95), 0 0 28px rgba(0,0,0,0.85); }
.rl-scope-row { display: grid; grid-template-columns: 1fr 126px; gap: 8px; align-items: center; margin-top: 6px; }
.rl-scope-box { background: #0b0c10; border: 1px solid #262932; border-radius: 6px; padding: 4px 6px; }
.rl-curve-box { background: #0b0c10; border: 1px solid #262932; border-radius: 6px; padding: 4px; display: flex; flex-direction: column; align-items: center; }
.rl-ai-script-box { background: rgba(15, 23, 42, 0.72); border: 1px solid #334155; border-radius: 8px; padding: 8px; margin-top: 6px; font-size: 11px; color: #e2e8f0; display: flex; flex-direction: column; gap: 6px; }

/* SHOT DESIGNER 2D */
.sd-top-controls, .sd-tools-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 10px;
}
.sd-axis-warn { font-size: 11px; font-weight: 800; color: #fecaca; background: rgba(239,68,68,0.24); border: 1px solid #ef4444; padding: 3px 8px; border-radius: 999px; }
.sd-axis-ok { font-size: 11px; font-weight: 800; color: #86efac; background: rgba(16,185,129,0.16); border: 1px solid #10b981; padding: 3px 8px; border-radius: 999px; }
.sd-workspace-split { display: grid; grid-template-columns: 1fr minmax(280px, 340px); gap: 12px; align-items: start; }
.sd-canvas-col { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 8px; min-width: 0; }
.sd-canvas { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid #334155; cursor: crosshair; }
.sd-anim-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.sd-side-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sd-panel-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px; }
.sd-insp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 11px; }
.sd-insp-grid label { display: block; font-size: 10.5px; color: var(--text-muted); margin-bottom: 2px; }
.sd-shot-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-height: 240px; overflow-y: auto; }
.sd-shot-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border-color); font-size: 11.5px; }

@media (max-width: 980px) {
  .inv-layer2-layout, .inv-layer3-grid, .rl-main-split, .sd-workspace-split {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   HISPANOFILM.ORG — PORTAL SAAS DE 3 ÁREAS (GUION · REGISTRO LEGAL · ADMIN)
   ============================================================================ */
.cs-login-gate {
  align-items: flex-start;
  overflow-y: auto;
  padding: 20px 14px;
}
.cs-login-card {
  margin: auto;
}
.cs-login-card.cs-login-card-portal {
  max-width: 1020px;
  width: 100%;
}
.hf-portal-topbar-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.hf-verify-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.45);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.hf-verify-quick-link:hover {
  background: rgba(56, 189, 248, 0.26);
  transform: translateY(-1px);
}
.hf-portal-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.hf-pt-title {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 3px;
}
.hf-pt-sub {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  line-height: 1.3;
}
@media (max-width: 900px) {
  .hf-portal-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.hf-portal-tab {
  text-align: left;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.hf-portal-tab:hover {
  border-color: rgba(56, 189, 248, 0.65);
  transform: translateY(-1px);
}
.hf-portal-tab.is-active {
  border-color: #38bdf8;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.28), rgba(16, 185, 129, 0.18));
  color: #f8fafc;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.22);
}
.hf-portal-tab-title {
  font-size: 13px;
  font-weight: 900;
  color: #f8fafc;
  margin-bottom: 3px;
}
.hf-portal-tab-sub {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.3;
}
.hf-area-banner {
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.hf-area-banner-title {
  font-size: 14.5px;
  font-weight: 900;
  color: #f8fafc;
}
.hf-area-banner-desc {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 4px;
  line-height: 1.45;
}
.hf-submode-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.hf-submode-btn {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.hf-submode-btn.is-active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  color: #d1fae5;
}
.hf-section-lbl {
  font-size: 11.5px;
  font-weight: 900;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 10px 0 8px 0;
}
.hf-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.hf-plan-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.78);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.hf-plan-card:hover {
  border-color: rgba(56, 189, 248, 0.6);
}
.hf-plan-card.is-selected {
  border: 2px solid #10b981;
  background: rgba(16, 185, 129, 0.14);
}
.hf-plan-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}
.hf-plan-name {
  font-size: 13.5px;
  font-weight: 900;
  color: #fff;
}
.hf-plan-price {
  font-size: 16px;
  font-weight: 900;
  color: #6ee7b7;
}
.hf-plan-feats {
  margin: 4px 0 0 0;
  padding-left: 16px;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
}
.hf-signup-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.hf-signup-inputs label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 4px;
}
.hf-gw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.hf-gw-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.hf-gw-btn.is-selected {
  border: 2px solid #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  color: #fff;
}

@media (max-width: 640px) {
  .hf-portal-tabs,
  .hf-submode-bar,
  .hf-signup-inputs,
  .hf-gw-grid {
    grid-template-columns: 1fr;
  }
  .cs-login-card.cs-login-card-portal {
    padding: 16px 14px;
  }
}

/* ============================================================================
   PORTAL UNIFICADO CON IDENTIDAD GRÁFICA CESCO TECHNOLOGIES (#FFFFFF/#F8FAFC/#0088CC/#0F2942)
   ============================================================================ */
.cs-login-gate {
  background:
    radial-gradient(circle at 14% 12%, rgba(0, 180, 240, 0.14), transparent 44%),
    radial-gradient(circle at 86% 88%, rgba(0, 136, 204, 0.12), transparent 48%),
    linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 52%, #E2E8F0 100%);
}
.cs-login-card.cs-portal-cesco-theme {
  background: #FFFFFF;
  color: #0F2942;
  border: 1.5px solid #BAE6FD;
  box-shadow: 0 24px 64px rgba(15, 41, 66, 0.14);
}
.cs-portal-cesco-theme .cs-login-brand-header {
  border-bottom: 1px solid #E2E8F0;
}
.cs-portal-cesco-theme .cs-login-logo-box {
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 4px 12px rgba(15, 41, 66, 0.08);
}
.cs-portal-cesco-theme .cs-login-company-name {
  color: #0F2942;
}
.cs-portal-cesco-theme .cs-login-legal-name {
  color: #0077B6;
}
.cs-portal-cesco-theme .cs-login-contact-line {
  color: #475569;
}
.hf-cesco-partner-pill {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
}
.cs-portal-cesco-theme .hf-verify-quick-link {
  background: #F0F9FF;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}
.cs-portal-cesco-theme .hf-verify-quick-link:hover {
  background: #E0F2FE;
}
.cs-portal-cesco-theme .hf-portal-tab {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #0F2942;
}
.cs-portal-cesco-theme .hf-portal-tab:hover {
  border-color: #0095D9;
  background: #F0F9FF;
}
.cs-portal-cesco-theme .hf-portal-tab.is-active {
  background: linear-gradient(135deg, #0088CC, #005596);
  border-color: #00447A;
  color: #FFFFFF;
  box-shadow: 0 8px 22px rgba(0, 136, 204, 0.25);
}
.cs-portal-cesco-theme .hf-area-banner {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  color: #0F2942;
}
.cs-portal-cesco-theme .hf-submode-btn {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #334155;
}
.cs-portal-cesco-theme .hf-submode-btn.is-active {
  background: #0F2942;
  border-color: #0F2942;
  color: #FFFFFF;
}
.cs-portal-cesco-theme .cs-login-field label,
.cs-portal-cesco-theme .hf-signup-inputs label,
.cs-portal-cesco-theme .cs-login-remember {
  color: #0F2942;
}
.cs-portal-cesco-theme .form-input {
  background: #FFFFFF;
  color: #0F2942;
  border: 1px solid #CBD5E1;
}
.cs-portal-cesco-theme .cs-login-link-btn {
  color: #0077B6;
}
.cs-portal-cesco-theme .cs-login-submit-btn {
  background: linear-gradient(135deg, #0095D9, #005596);
  color: #FFFFFF;
}
.cs-portal-cesco-theme .hf-section-lbl {
  color: #0369A1;
}
.cs-portal-cesco-theme .hf-plan-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #0F2942;
}
.cs-portal-cesco-theme .hf-plan-card.is-selected {
  background: #F0F9FF;
  border: 2px solid #0088CC;
}
.cs-portal-cesco-theme .hf-plan-badge {
  background: #E0F2FE;
  color: #0369A1;
}
.cs-portal-cesco-theme .hf-plan-name {
  color: #0F2942;
}
.cs-portal-cesco-theme .hf-plan-price {
  color: #0077B6;
}
.cs-portal-cesco-theme .hf-plan-feat {
  font-size: 11px;
  color: #475569;
  line-height: 1.35;
}
.cs-portal-cesco-theme .hf-gw-btn {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  color: #0F2942;
}
.cs-portal-cesco-theme .hf-gw-btn.is-selected {
  background: #E0F2FE;
  border: 2px solid #0088CC;
  color: #0F2942;
}
.cs-portal-cesco-theme .cs-login-footer {
  border-top: 1px solid #E2E8F0;
  color: #64748B;
}

/* Separador de subgrupos dentro del submenú contextual (Ej. 03 Producción) */
.cs-submenu-divider {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 10px 4px 10px;
  margin-top: 6px;
  color: #94a3b8;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.cs-submenu-divider:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 4px;
}
[data-theme="light"] .cs-submenu-divider {
  color: #0369A1;
  border-top-color: #E2E8F0;
}

/* ============================================================================
   CESCO TECHNOLOGIES SOCIAL SUITE (#view-cesco-social)
   ============================================================================ */
.cesco-suite-shell {
  background: #F8FAFC;
  color: #0F2942;
  padding: 10px 14px 24px;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.cesco-suite-topbar {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  box-shadow: 0 2px 10px rgba(15, 41, 66, 0.04);
}
.cesco-brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.cesco-brand-lockup > div:not(.cesco-suite-divider) {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.cesco-suite-divider {
  width: 1px;
  height: 28px;
  background: #E2E8F0;
  flex-shrink: 0;
}
.cesco-suite-kicker {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #0088CC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cesco-suite-workspace-name {
  font-size: 12.5px;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cesco-topbar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
@media (max-width: 1180px) {
  .cesco-suite-topbar, .cesco-topbar-controls { flex-wrap: wrap; }
}
.cesco-ctrl-group {
  display: flex;
  align-items: center;
  gap: 5px;
}
.cesco-ctrl-group label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}
.cesco-sec-badge {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  font-size: 10.5px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.cesco-pills-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: #FFFFFF;
  padding: 10px;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
}
.cesco-nav-pill {
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #0F2942;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.cesco-nav-pill:hover {
  background: #E0F2FE;
  border-color: #0095D9;
  color: #005596;
}
.cesco-nav-pill.active {
  background: #005596;
  color: #FFFFFF;
  border-color: #00447A;
}
.cesco-subtabs-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cesco-subtab {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F2942;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.cesco-subtab.active {
  background: #0F2942;
  color: #FFFFFF;
  border-color: #0F2942;
}
.cesco-suite-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cesco-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.cesco-kpi-card,
.cesco-panel {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(15, 41, 66, 0.03);
}
.cesco-kpi-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748B;
}
.cesco-kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: #0F2942;
  margin: 3px 0;
}
.cesco-kpi-delta {
  font-size: 12px;
  color: #475569;
}
.cesco-kpi-delta.is-up {
  color: #047857;
  font-weight: 700;
}
.cesco-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 10px;
  align-items: start;
}
.cesco-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cesco-panel-head h3 {
  margin: 0;
  font-size: 15.5px;
  color: #0F2942;
}
.cesco-panel-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748B;
}
.cesco-btn {
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cesco-btn-primary {
  background: #005596;
  color: #FFFFFF;
}
.cesco-btn-primary:hover {
  background: #00447A;
}
.cesco-btn-ghost {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F2942;
}
.cesco-btn-ghost:hover {
  background: #E0F2FE;
  border-color: #0088CC;
}
.cesco-input,
.cesco-select,
.cesco-textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0F2942;
  font-size: 12.5px;
  font-family: inherit;
}
.cesco-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}
.cesco-form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cesco-form-row2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.cesco-inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.cesco-pill-blue {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: #E0F2FE;
  color: #0369A1;
  font-size: 11px;
  font-weight: 800;
}
.cesco-status-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.cesco-status-pill.is-ok {
  background: #D1FAE5;
  color: #065F46;
}
.cesco-status-pill.is-off {
  background: #FEF3C7;
  color: #92400E;
}
.cesco-bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  height: 175px;
  padding-top: 16px;
}
.cesco-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.cesco-bar-val {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
}
.cesco-bar-track {
  width: 100%;
  max-width: 34px;
  flex: 1;
  background: #F1F5F9;
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.cesco-bar-fill {
  width: 100%;
  border-radius: 8px 8px 0 0;
}
.cesco-bar-day {
  font-size: 11px;
  font-weight: 700;
  color: #0F2942;
}
.cesco-quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.cesco-quick-tile {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #0F2942;
}
.cesco-quick-tile:hover {
  background: #E0F2FE;
  border-color: #0088CC;
}
.cesco-tone-box {
  margin-top: 10px;
  padding: 10px;
  background: #F8FAFC;
  border-left: 3px solid #0088CC;
  border-radius: 6px;
  font-size: 12px;
  color: #334155;
}
.cesco-net-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 6px;
}
.cesco-net-chip {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}
.cesco-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cesco-grid-layout {
  display: grid;
  grid-template-columns: minmax(410px, 1.15fr) minmax(320px, 0.85fr);
  gap: 12px;
  align-items: start;
}
@media (max-width: 960px) {
  .cesco-grid-layout { grid-template-columns: 1fr; }
}
.cesco-ig-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.cesco-ig-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #E2E8F0;
  cursor: pointer;
  background: #0F2942;
}
.cesco-ig-tile.is-selected {
  border-color: #0088CC;
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.25);
}
.cesco-ig-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cesco-tile-badge,
.cesco-tile-status {
  position: absolute;
  top: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(15, 41, 66, 0.85);
  color: #FFFFFF;
}
.cesco-tile-badge { left: 6px; }
.cesco-tile-status { right: 6px; background: rgba(0, 136, 204, 0.92); }
.cesco-tile-actions {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
}
.cesco-tile-actions button {
  background: rgba(255, 255, 255, 0.92);
  color: #0F2942;
  border: none;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 10px;
  cursor: pointer;
  font-weight: 800;
}
.cesco-pill-switch {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cesco-pill-btn {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #0F2942;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.cesco-pill-btn.active {
  background: #005596;
  color: #FFFFFF;
  border-color: #00447A;
}
.cesco-phone-stage {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.cesco-phone-frame {
  width: 280px;
  background: #0F2942;
  padding: 12px;
  border-radius: 34px;
  box-shadow: 0 20px 44px rgba(15, 41, 66, 0.22);
}
.cesco-phone-notch {
  width: 86px;
  height: 12px;
  background: #020617;
  border-radius: 999px;
  margin: 0 auto 8px;
}
.cesco-phone-screen {
  background: #FFFFFF;
  border-radius: 22px;
  min-height: 440px;
  padding: 10px;
  color: #0F2942;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cesco-phone-top {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 6px;
}
.cesco-phone-media {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.cesco-phone-media.is-tall {
  aspect-ratio: 9 / 14;
}
.cesco-phone-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cesco-reel-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(15, 41, 66, 0.92));
  color: #FFFFFF;
  font-size: 11px;
}
.cesco-story-cta {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  color: #005596;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.cesco-feed-caption {
  font-size: 11.5px;
  color: #1E293B;
  line-height: 1.4;
}
.cesco-phone-profile-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cesco-avatar-lg {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #FFFFFF;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cesco-phone-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.cesco-phone-mini-grid img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}
.cesco-phone-meta {
  flex: 1;
  min-width: 240px;
}
.cesco-meta-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.cesco-meta-badges span {
  background: #F1F5F9;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
}
.cesco-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.cesco-table th,
.cesco-table td {
  padding: 10px;
  border-bottom: 1px solid #E2E8F0;
  text-align: left;
}
.cesco-table th {
  background: #F8FAFC;
  font-size: 11px;
  text-transform: uppercase;
  color: #475569;
}
.cesco-row-highlight {
  background: #F0F9FF;
}
.cesco-heat-cell {
  border: none;
  border-radius: 7px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 11.5px;
  cursor: pointer;
  width: 100%;
}
.cesco-networks-grid,
.cesco-cards-grid,
.cesco-plans-grid,
.cesco-export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}
.cesco-network-card,
.cesco-brand-card,
.cesco-trend-card,
.cesco-plan-card,
.cesco-export-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cesco-export-card {
  text-align: left;
  cursor: pointer;
  color: #0F2942;
}
.cesco-export-card:hover {
  background: #E0F2FE;
  border-color: #0088CC;
}
.cesco-network-top,
.cesco-brand-head,
.cesco-trend-top {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.cesco-network-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #FFFFFF;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.cesco-network-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #FFFFFF;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
}
.cesco-network-metrics span {
  display: block;
  font-size: 10px;
  color: #64748B;
}
.cesco-network-metrics strong {
  font-size: 12px;
  color: #0F2942;
}
.cesco-oauth-scope {
  font-size: 10.5px;
  color: #64748B;
  word-break: break-word;
}
.cesco-hooks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.cesco-hook-btn {
  text-align: left;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #0F2942;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
}
.cesco-hook-btn:hover {
  background: #E0F2FE;
  border-color: #0088CC;
}
.cesco-utm-output {
  margin-top: 14px;
  padding: 12px;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cesco-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.cesco-rgb-box {
  display: flex;
  gap: 12px;
  font-size: 11.5px;
  background: #FFFFFF;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid #E2E8F0;
}
.cesco-brand-card.is-active {
  border: 2px solid #0088CC;
  background: #F0F9FF;
}
.cesco-inline-drawer {
  background: #FFFFFF;
  border: 2px solid #0088CC;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 136, 204, 0.14);
}
.cesco-rec-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cesco-rec-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cesco-rec-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cesco-rec-meta {
  font-size: 11.5px;
  color: #64748B;
  margin-top: 4px;
}
.cesco-first-frame {
  font-size: 12px;
  color: #334155;
  background: #FFFFFF;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
}
.cesco-takes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.cesco-take-chip {
  padding: 8px;
  border-radius: 8px;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cesco-take-chip.is-ok { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.cesco-take-chip.is-discard { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.cesco-cal-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 900px) {
  .cesco-cal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.cesco-cal-cell {
  min-height: 92px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cesco-cal-num {
  font-size: 11px;
  font-weight: 800;
  color: #64748B;
}
.cesco-cal-efem {
  font-size: 10px;
  background: #FEF3C7;
  color: #92400E;
  padding: 2px 5px;
  border-radius: 5px;
  font-weight: 700;
}
.cesco-cal-ev {
  font-size: 10.5px;
  background: #E0F2FE;
  color: #0F2942;
  padding: 3px 6px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}
.cesco-efem-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}
.cesco-efem-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.cesco-mini-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #0088CC;
  background: #FFFFFF;
  color: #005596;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.cesco-gantt {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cesco-gantt-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: center;
}
.cesco-gantt-track {
  background: #F1F5F9;
  border-radius: 8px;
  padding: 4px;
}
.cesco-gantt-bar {
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 6px;
}
.cesco-inbox-3col {
  display: grid;
  grid-template-columns: 280px 1fr 250px;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 14px;
}
@media (max-width: 980px) {
  .cesco-inbox-3col { grid-template-columns: 1fr; }
}
.cesco-inbox-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid #E2E8F0;
  padding-right: 10px;
}
.cesco-inbox-item {
  display: flex;
  gap: 10px;
  text-align: left;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 9px;
  cursor: pointer;
  color: #0F2942;
}
.cesco-inbox-item.is-selected {
  background: #E0F2FE;
  border-color: #0088CC;
}
.cesco-inbox-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0F2942;
  color: #FFFFFF;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
}
.cesco-inbox-meta p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #475569;
}
.cesco-thread-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  margin-bottom: 12px;
}
.cesco-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 85%;
  font-size: 12.5px;
}
.cesco-bubble.is-lead { background: #F1F5F9; align-self: flex-start; }
.cesco-bubble.is-agent { background: #E0F2FE; align-self: flex-end; }
.cesco-ads-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cesco-ads-camp {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px;
}
.cesco-ads-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.cesco-ads-head h4 { margin: 2px 0 0; font-size: 14px; }
.cesco-ads-kpis { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.cesco-adset-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 12px;
}
.cesco-ads-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.cesco-ad-leaf {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #7DD3FC;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.16s ease;
}
.cesco-ad-leaf:hover {
  background: #BAE6FD;
  color: #0C4A6E;
  border-color: #0284C7;
  transform: translateY(-1px);
}
.cesco-calc-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.cesco-calc-results div {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.cesco-calc-results span { display: block; font-size: 11px; color: #64748B; }
.cesco-calc-results strong { font-size: 18px; color: #0F2942; }
.cesco-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cesco-audit-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  cursor: pointer;
}
.cesco-audit-item.is-warn { border-color: #F59E0B; background: #FFFBEB; }
.cesco-audit-item p { margin: 3px 0 0; font-size: 12px; color: #475569; }
.cesco-slide-stage {
  background: linear-gradient(135deg, #FFFFFF, #F0F9FF);
  border: 1.5px solid #BAE6FD;
  border-radius: 16px;
  padding: 28px;
}
.cesco-slide-tag {
  font-size: 11px;
  font-weight: 800;
  color: #0088CC;
  letter-spacing: 0.1em;
}
.cesco-slide-stage h2 {
  font-size: 24px;
  color: #0F2942;
  margin: 8px 0;
}
.cesco-slide-sub {
  font-size: 14px;
  color: #475569;
  margin-bottom: 14px;
}
.cesco-slide-bullets {
  padding-left: 20px;
  line-height: 1.75;
  color: #1E293B;
}
.cesco-slide-kpi {
  margin-top: 18px;
  padding: 14px;
  background: #FFFFFF;
  border-left: 4px solid #0088CC;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.cesco-slide-kpi strong { font-size: 22px; color: #005596; }
.cesco-sl-list { display: flex; flex-direction: column; gap: 8px; }
.cesco-sl-row {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.cesco-sl-row small { display: block; color: #64748B; }
.cesco-bio-links { display: flex; flex-direction: column; gap: 8px; }
.cesco-bio-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 10px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  background: #F1F5F9;
  color: #0F2942;
  border: 1px solid #CBD5E1;
}
.cesco-bio-btn.is-featured {
  background: #005596;
  color: #FFFFFF;
  border-color: #00447A;
}
.cesco-plan-card.is-featured {
  border: 2px solid #0088CC;
  background: #F0F9FF;
}
.cesco-plan-card.is-vip {
  border: 2px solid #0F2942;
  background: #FFFFFF;
}
.cesco-plan-badge {
  align-self: flex-start;
  background: #E0F2FE;
  color: #0369A1;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}
.cesco-plan-price strong { font-size: 26px; color: #0F2942; }
.cesco-plan-list {
  padding-left: 16px;
  margin: 0;
  font-size: 12px;
  color: #334155;
  line-height: 1.6;
  flex: 1;
}
.cesco-perm-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.cesco-perm-tag {
  font-size: 10.5px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  padding: 2px 7px;
  border-radius: 6px;
  color: #0F2942;
}
.cesco-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #0F2942;
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(15, 41, 66, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 200000;
}
.cesco-toast.show { opacity: 1; }

/* Channel Bar & Native 9-Network Clone Stage */
button.cesco-net-chip {
  cursor: pointer;
  color: #0F2942;
  font-family: inherit;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}
button.cesco-net-chip:hover {
  border-color: #0088CC;
  background: #F0F9FF;
  transform: translateY(-1px);
}
.cesco-channel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 5px 8px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(15, 41, 66, 0.04);
}
.cesco-channel-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  flex: 1 1 auto;
}
.cesco-channel-pills::-webkit-scrollbar { display: none; }
.cesco-ch-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #0F2942;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.14s ease;
}
.cesco-ch-pill:hover { border-color: #0088CC; background: #E0F2FE; }
.cesco-ch-pill.active {
  background: #0F2942;
  color: #FFFFFF;
  border-color: #0F2942;
  box-shadow: 0 1px 3px rgba(15, 41, 66, 0.2);
}
.cesco-ch-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.cesco-ch-dot.is-real { background: #10B981; }
.cesco-ch-dot.is-local { background: #38BDF8; }
.cesco-ch-dot.is-off { background: #94A3B8; }
.cesco-subtabs-compact {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  padding: 3px;
}
.cesco-subtabs-compact .cesco-subtab {
  background: transparent;
  border: none;
  color: #475569;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.cesco-subtabs-compact .cesco-subtab:hover {
  color: #0F2942;
  background: rgba(255, 255, 255, 0.75);
}
.cesco-subtabs-compact .cesco-subtab.active {
  background: #0088CC;
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(0, 136, 204, 0.28);
}
@media (max-width: 1120px) {
  .cesco-channel-bar { flex-wrap: wrap; gap: 6px; }
  .cesco-subtabs-compact { margin-left: auto; }
}
.cesco-add-piece-bar { display: flex; gap: 8px; align-items: center; }
.cesco-clone-stage {
  display: flex;
  justify-content: center;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 10px;
}
.cesco-clone-hoverbar {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  display: flex;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 4;
}
.cesco-ig-mosaic-tile:hover .cesco-clone-hoverbar,
.cesco-tt-tile:hover .cesco-clone-hoverbar,
.cesco-yt-thumb:hover .cesco-clone-hoverbar,
.cesco-web-card:hover .cesco-clone-hoverbar,
.cesco-tw-vod:hover .cesco-clone-hoverbar,
.cesco-pin-media:hover .cesco-clone-hoverbar { opacity: 1; }
.cesco-clone-hoverbar button {
  border: none;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.84);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  cursor: pointer;
}
.cesco-clone-mini-btn {
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0F2942;
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.cesco-clone-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #0F2942;
  background: #E2E8F0;
}

/* 1. EXACT INSTAGRAM CLONE (PROFILE + 3:4 EDGE-TO-EDGE MOSAIC) */
.cesco-ig-phone-clone {
  width: 100%;
  max-width: 416px;
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 41, 66, 0.14);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.cesco-ig-statusbar {
  display: flex;
  justify-content: space-between;
  padding: 8px 18px 2px;
  font-size: 11px;
  font-weight: 700;
  color: #0F172A;
}
.cesco-ig-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px 10px;
}
.cesco-ig-handle-top {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
}
.cesco-ig-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #0095F6;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
}
.cesco-ig-top-icons {
  display: flex;
  gap: 10px;
}
.cesco-ig-top-icons button {
  border: none;
  background: transparent;
  font-size: 18px;
  color: #0F172A;
  cursor: pointer;
  padding: 2px 4px;
}
.cesco-ig-header-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 4px 16px 10px;
}
.cesco-ig-story-ring {
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(45deg, #FCAF45, #FD1D1D, #C13584, #833AB4);
  cursor: pointer;
  flex-shrink: 0;
}
.cesco-ig-ring-inner {
  padding: 2px;
  border-radius: 50%;
  background: #FFFFFF;
}
.cesco-ig-stats {
  display: flex;
  flex: 1;
  justify-content: space-around;
  text-align: center;
}
.cesco-ig-stats strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.2;
}
.cesco-ig-stats span {
  font-size: 11px;
  color: #334155;
}
.cesco-ig-bio-block {
  padding: 0 16px 10px;
  font-size: 12.5px;
  line-height: 1.4;
}
.cesco-ig-name { font-weight: 700; color: #0F172A; }
.cesco-ig-cat { color: #64748B; font-size: 12px; }
.cesco-ig-bio-text { color: #0F172A; margin: 2px 0; }
.cesco-ig-bio-link {
  color: #00376B;
  font-weight: 600;
  text-decoration: none;
  font-size: 12px;
}
.cesco-ig-btn-row {
  display: flex;
  gap: 6px;
  padding: 0 14px 12px;
}
.cesco-ig-gray-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  background: #EFEFEF;
  color: #0F172A;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 10px;
  cursor: pointer;
}
.cesco-ig-gray-btn:hover { background: #E2E8F0; }
.cesco-ig-highlights {
  display: flex;
  gap: 14px;
  padding: 2px 16px 12px;
  overflow-x: auto;
}
.cesco-ig-hl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: #0F172A;
  min-width: 52px;
}
.cesco-ig-hl-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #0F2942;
}
.cesco-ig-tabs-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #E2E8F0;
}
.cesco-ig-tab-icon {
  border: none;
  border-bottom: 2px solid transparent;
  background: #FFFFFF;
  color: #64748B;
  padding: 9px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.cesco-ig-tab-icon.active {
  color: #0F172A;
  border-bottom-color: #0F172A;
}
.cesco-ig-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: #FFFFFF;
}
.cesco-ig-mosaic-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #E2E8F0;
  cursor: grab;
  border-radius: 0;
}
.cesco-ig-mosaic.is-square .cesco-ig-mosaic-tile {
  aspect-ratio: 1 / 1;
}
.cesco-ig-mosaic-tile.is-selected {
  outline: 2.5px solid #0095F6;
  outline-offset: -2.5px;
  z-index: 2;
}
.cesco-ig-mosaic-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cesco-ig-type-glyph {
  position: absolute;
  top: 7px;
  right: 7px;
  color: #FFFFFF;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.72));
  pointer-events: none;
}
.cesco-ig-bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 8px;
  border-top: 1px solid #E2E8F0;
  background: #FFFFFF;
  font-size: 16px;
}
.cesco-ig-nav-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0F2942;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 2. TIKTOK CLONE (9:16 3-COL GRID) */
.cesco-tt-phone-clone {
  width: 100%;
  max-width: 416px;
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 41, 66, 0.14);
}
.cesco-tt-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #F1F5F9;
}
.cesco-tt-profile-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 16px;
}
.cesco-tt-handle { font-weight: 800; font-size: 15px; margin-top: 8px; }
.cesco-tt-counters {
  display: flex;
  gap: 20px;
  margin: 10px 0;
}
.cesco-tt-counters strong { display: block; font-size: 15px; color: #0F172A; }
.cesco-tt-counters span { font-size: 11px; color: #64748B; }
.cesco-tt-cta-row { display: flex; gap: 8px; margin-bottom: 10px; }
.cesco-tt-follow-btn {
  border: none;
  border-radius: 6px;
  background: #FE2C55;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 20px;
  cursor: pointer;
}
.cesco-tt-sec-btn {
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  background: #FFFFFF;
  color: #0F172A;
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 14px;
  cursor: pointer;
}
.cesco-tt-bio { font-size: 12px; color: #334155; }
.cesco-tt-tabs {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
}
.cesco-tt-tabs .active { color: #0F172A; }
.cesco-tt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.cesco-tt-tile {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  cursor: grab;
  background: #0F172A;
}
.cesco-tt-tile.is-selected { outline: 2.5px solid #FE2C55; outline-offset: -2.5px; z-index: 2; }
.cesco-tt-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cesco-tt-pin {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #FE2C55;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.cesco-tt-views {
  position: absolute;
  bottom: 6px;
  left: 6px;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

/* 3. THREADS CLONE */
.cesco-threads-clone {
  width: 100%;
  max-width: 480px;
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  border-radius: 22px;
  padding: 16px;
}
.cesco-threads-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #E2E8F0;
}
.cesco-threads-name { font-size: 19px; font-weight: 800; }
.cesco-threads-sub { font-size: 13px; margin: 2px 0 8px; }
.cesco-threads-pill { background: #F1F5F9; color: #475569; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; }
.cesco-threads-bio { font-size: 13px; color: #334155; }
.cesco-threads-meta { font-size: 12px; color: #64748B; margin-top: 6px; }
.cesco-threads-list { display: flex; flex-direction: column; }
.cesco-thread-item {
  display: flex;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
}
.cesco-thread-item.is-selected { background: #F0F9FF; border-radius: 10px; }
.cesco-thread-rail { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cesco-thread-line { width: 2px; flex: 1; background: #CBD5E1; border-radius: 2px; min-height: 18px; }
.cesco-thread-body { flex: 1; font-size: 13px; }
.cesco-thread-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.cesco-thread-head span { color: #64748B; }
.cesco-thread-media { width: 100%; border-radius: 10px; margin: 6px 0; max-height: 220px; object-fit: cover; }
.cesco-thread-actions { display: flex; gap: 14px; align-items: center; color: #475569; font-size: 12px; margin-top: 6px; }
.cesco-inline-mv { border: 1px solid #CBD5E1; background: #fff; border-radius: 5px; font-size: 10px; padding: 1px 6px; cursor: pointer; }

/* 4. LINKEDIN & 9. FACEBOOK CLONES */
.cesco-li-clone, .cesco-fb-clone {
  width: 100%;
  max-width: 520px;
  background: #F4F2EE;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  border-radius: 16px;
  overflow: hidden;
}
.cesco-fb-clone { background: #F0F2F5; }
.cesco-li-cover, .cesco-fb-cover { height: 96px; }
.cesco-li-org-head {
  background: #FFFFFF;
  padding: 12px 16px 14px;
  position: relative;
}
.cesco-li-logo-box { margin-top: -42px; margin-bottom: 6px; border: 3px solid #fff; border-radius: 12px; display: inline-block; background: #fff; }
.cesco-li-org-info h4, .cesco-fb-header h4 { margin: 0; font-size: 17px; }
.cesco-li-org-info p { margin: 2px 0; font-size: 12.5px; color: #334155; }
.cesco-li-org-info small, .cesco-fb-header small { color: #64748B; font-size: 11.5px; }
.cesco-li-org-actions { display: flex; gap: 8px; margin-top: 10px; }
.cesco-li-btn-primary {
  background: #0A66C2;
  color: #FFFFFF;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.cesco-li-btn-outline {
  border: 1px solid #0A66C2;
  color: #0A66C2;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.cesco-li-feed, .cesco-fb-feed { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cesco-li-post, .cesco-fb-post {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}
.cesco-li-post.is-selected, .cesco-fb-post.is-selected { border-color: #0A66C2; box-shadow: 0 0 0 2px rgba(10, 102, 194, 0.16); }
.cesco-li-post-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.cesco-li-post-head strong { display: block; font-size: 13px; }
.cesco-li-post-head small { color: #64748B; font-size: 11px; }
.cesco-li-post-mv { margin-left: auto; display: flex; gap: 4px; }
.cesco-li-post-mv button { border: 1px solid #CBD5E1; background: #fff; border-radius: 5px; font-size: 10px; padding: 2px 6px; cursor: pointer; }
.cesco-li-post-text { font-size: 12.5px; color: #1E293B; margin-bottom: 8px; }
.cesco-li-post-img { width: 100%; border-radius: 8px; max-height: 220px; object-fit: cover; display: block; }
.cesco-li-post-bar {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #F1F5F9;
  padding-top: 8px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #475569;
  font-weight: 600;
}
.cesco-fb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  padding: 10px 14px 14px;
}
.cesco-fb-av { margin-top: -32px; border: 3px solid #fff; border-radius: 50%; background: #fff; }
.cesco-fb-cta {
  margin-left: auto;
  background: #1877F2;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
}

/* 5. YOUTUBE, 6. WEB, 7. TWITCH, 8. PINTEREST CLONES */
.cesco-yt-clone, .cesco-web-clone, .cesco-pin-clone {
  width: 100%;
  max-width: 540px;
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  border-radius: 16px;
  overflow: hidden;
  padding-bottom: 12px;
}
.cesco-yt-banner {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
}
.cesco-yt-header { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.cesco-yt-meta { flex: 1; }
.cesco-yt-meta h4 { margin: 0; font-size: 16px; }
.cesco-yt-meta small { color: #64748B; font-size: 11.5px; }
.cesco-yt-meta p { margin: 4px 0 0; font-size: 11.5px; color: #334155; }
.cesco-yt-sub-pill { background: #0F172A; color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 700; }
.cesco-yt-tabs { display: flex; gap: 18px; padding: 8px 16px; border-bottom: 1px solid #E2E8F0; font-size: 12.5px; font-weight: 700; color: #64748B; }
.cesco-yt-tabs .active { color: #0F172A; border-bottom: 2px solid #0F172A; padding-bottom: 4px; }
.cesco-yt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
.cesco-yt-card { cursor: pointer; }
.cesco-yt-card.is-selected .cesco-yt-thumb { outline: 2.5px solid #FF0000; }
.cesco-yt-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #0F172A; }
.cesco-yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cesco-yt-dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.84); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 5px; border-radius: 4px; }
.cesco-yt-card-title { font-size: 12.5px; font-weight: 700; margin-top: 5px; color: #0F172A; }
.cesco-yt-card-sub { font-size: 11px; color: #64748B; }
.cesco-yt-shorts-label { padding: 4px 14px; font-size: 12.5px; font-weight: 800; color: #0F172A; }
.cesco-yt-shorts-row { display: flex; gap: 8px; padding: 4px 14px; overflow-x: auto; }
.cesco-yt-short { width: 106px; flex-shrink: 0; aspect-ratio: 9 / 16; position: relative; border-radius: 10px; overflow: hidden; cursor: pointer; }
.cesco-yt-short img { width: 100%; height: 100%; object-fit: cover; }
.cesco-yt-short span { position: absolute; bottom: 6px; left: 6px; right: 6px; color: #fff; font-size: 10.5px; font-weight: 700; text-shadow: 0 1px 4px #000; }

.cesco-web-chrome { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #F1F5F9; border-bottom: 1px solid #E2E8F0; }
.cesco-web-dots { display: flex; gap: 5px; }
.cesco-web-dots span { width: 9px; height: 9px; border-radius: 50%; background: #94A3B8; }
.cesco-web-url { flex: 1; background: #fff; border: 1px solid #CBD5E1; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; color: #334155; }
.cesco-web-nav { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid #F1F5F9; font-size: 12px; }
.cesco-web-nav > div { display: flex; gap: 12px; align-items: center; color: #475569; }
.cesco-web-nav-cta { background: #0088CC; color: #fff; padding: 4px 10px; border-radius: 6px; font-weight: 700; }
.cesco-web-hero { margin: 12px; border: 1px solid #E2E8F0; border-radius: 12px; overflow: hidden; cursor: pointer; }
.cesco-web-hero.is-selected { outline: 2.5px solid #0088CC; }
.cesco-web-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.cesco-web-hero-body { padding: 10px 12px; }
.cesco-web-tag { font-size: 10px; font-weight: 800; color: #0088CC; letter-spacing: 0.06em; }
.cesco-web-hero-body h4 { margin: 4px 0; font-size: 15px; }
.cesco-web-hero-body p { margin: 0; font-size: 12px; color: #475569; }
.cesco-web-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px; }
.cesco-web-card { position: relative; border: 1px solid #E2E8F0; border-radius: 10px; overflow: hidden; cursor: pointer; padding-bottom: 8px; }
.cesco-web-card.is-selected { border-color: #0088CC; }
.cesco-web-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; margin-bottom: 6px; }
.cesco-web-card strong { display: block; padding: 0 8px; font-size: 12px; }
.cesco-web-card small { display: block; padding: 2px 8px 0; font-size: 10.5px; color: #64748B; }

.cesco-tw-clone {
  width: 100%;
  max-width: 540px;
  background: #0E0E10;
  color: #FFFFFF;
  border: 2px solid #9146FF;
  border-radius: 16px;
  overflow: hidden;
  padding: 12px;
}
.cesco-tw-stage { position: relative; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.cesco-tw-stage img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.cesco-tw-live-pill { position: absolute; top: 10px; left: 10px; background: #EB0400; color: #fff; font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 4px; }
.cesco-tw-stage-meta { display: flex; align-items: center; gap: 10px; padding: 10px 4px; }
.cesco-tw-stage-meta strong { display: block; font-size: 13.5px; }
.cesco-tw-stage-meta small { color: #C4B5FD; font-size: 11.5px; }
.cesco-tw-vods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cesco-tw-vod { position: relative; background: #18181B; border-radius: 8px; overflow: hidden; cursor: pointer; padding-bottom: 6px; }
.cesco-tw-vod.is-selected { outline: 2px solid #A970FF; }
.cesco-tw-vod img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.cesco-tw-vod-dur { position: absolute; top: 6px; left: 6px; background: rgba(0, 0, 0, 0.78); color: #fff; font-size: 10px; padding: 2px 5px; border-radius: 4px; }
.cesco-tw-vod-title { padding: 6px 8px 0; font-size: 11.5px; font-weight: 700; color: #F8FAFC; }

.cesco-pin-header { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; text-align: center; }
.cesco-pin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px; }
.cesco-pin-card { cursor: pointer; }
.cesco-pin-media { position: relative; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; }
.cesco-pin-card.is-selected .cesco-pin-media { outline: 3px solid #E60023; }
.cesco-pin-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cesco-pin-save { position: absolute; top: 8px; right: 8px; background: #E60023; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.cesco-pin-title { font-size: 12px; font-weight: 700; padding: 5px 4px; color: #0F172A; }

/* OAuth 2.0 Config & Status */
.cesco-oauth-status-banner {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid #BAE6FD;
  background: #F0F9FF;
  color: #0F2942;
  font-size: 13px;
}
.cesco-oauth-status-banner.is-real {
  border-color: #6EE7B7;
  background: #ECFDF5;
  color: #064E3B;
}
.cesco-oauth-status-banner.is-local-dev {
  border-color: #FDE68A;
  background: #FFFBEB;
  color: #78350F;
}
.cesco-oauth-config-box {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  padding: 14px;
}
.cesco-form-row3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 960px) {
  .cesco-form-row3 { grid-template-columns: 1fr; }
}










/* ============================================================================
   MENÚ UNIFICADO A LA IZQUIERDA Y OPTIMIZACIÓN DE PANTALLA COMPLETA
   Oculta las barras horizontales duplicadas cuando el menú lateral izquierdo
   está visible, compacta cabeceras y aprovecha el 100% del ancho de pantalla.
   ============================================================================ */
.cs-dup-horiz-subnav {
  display: none !important;
}
body.cs-left-sidebar-hidden .cs-dup-horiz-subnav,
body.cs-view-maximized .cs-dup-horiz-subnav {
  display: flex !important;
}
@media (max-width: 860px) {
  .cs-dup-horiz-subnav {
    display: flex !important;
  }
}

.app-layout,
.main-workspace,
.view-section,
.view-section.active {
  width: 100%;
  max-width: 100%;
}

.topbar-row-primary {
  padding-top: 4px;
  padding-bottom: 4px;
  gap: 8px;
}

.topbar-row-utility {
  padding-top: 3px;
  padding-bottom: 3px;
  gap: 6px;
}

.workflow-ribbon {
  min-height: 28px;
  padding: 3px 10px;
}

.area-id-bar {
  padding: 2px 10px;
  min-height: 22px;
  font-size: 10px;
}

.sidebar-nav .nav-list {
  padding: 5px 8px;
}

.sidebar-nav .nav-item {
  padding: 6px 9px;
  font-size: 12px;
}

.cesco-suite-shell {
  padding: 10px 14px 20px;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.cesco-suite-topbar {
  padding: 8px 12px;
  gap: 10px;
  border-radius: 10px;
}

.cesco-kpi-strip {
  gap: 10px;
}

.cesco-card {
  padding: 12px 14px;
  border-radius: 12px;
}

body.cs-workspace-fullscreen .app-layout,
body.cs-view-maximized .app-layout {
  width: 100vw;
  max-width: 100vw;
}


/* ============================================================================
   LÍMITE ESTRICTO DE FORMATO DE LOGOTIPOS (NUNCA SUPERIORES A 50x50 PX)
   Garantiza que todos los logos institucionales y de marca mantengan proporción
   y nunca superen 50x50 píxeles en ningún dispositivo o resolución.
   ============================================================================ */
.brand-logo-img,
.brand-logo-img-wrap img,
.dashboard-header-logo img,
.cs-login-logo-img,
.cs-area-brand-logo img,
.cesco-official-logo-pill img,
.cesco-procreart-logo-pill img,
.safe-registry-brand img,
.brand-logo-item img,
.brand-strip-4logos img,
.brand-strip-4logos svg,
img[src*="logo"],
img[src*="cesco"],
img[src*="procreart"],
img[src*="redmouse"],
img[src*="red_safe"],
svg.brand-logo-svg {
  max-width: 50px !important;
  max-height: 50px !important;
  object-fit: contain !important;
}

/* Logos de Inicio, Portal, Login y Dashboard estrictamente limitados a un máximo de 50x50 px */
.dashboard-header-logo,
.dashboard-header-logo img,
.cs-login-logo-box,
.cs-login-logo-img {
  width: 50px !important;
  height: 50px !important;
  max-width: 50px !important;
  max-height: 50px !important;
  object-fit: contain !important;
}

body[data-active-view="cesco-social"] .cs-hide-in-cesco {
  display: none !important;
}

#cs-cesco-topbar-brand {
  display: none;
  align-items: center;
  gap: 10px;
}

body[data-active-view="cesco-social"] #cs-cesco-topbar-brand {
  display: inline-flex;
}

.cs-area-brand-logo {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 124px;
  height: 38px;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.cs-area-brand-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#cs-hispanofilm-topbar-brand { width: 128px; }
#cs-safemouse-topbar-brand { width: 52px; }

body[data-active-view="dashboard"] #cs-hispanofilm-topbar-brand,
body[data-active-view="legal-registry"] #cs-safemouse-topbar-brand {
  display: inline-flex;
}

body[data-active-view="dashboard"] .brand-logo-img-wrap,
body[data-active-view="cesco-social"] .brand-logo-img-wrap,
body[data-active-view="legal-registry"] .brand-logo-img-wrap {
  display: none !important;
}

body[data-active-view]:not([data-active-view="dashboard"]):not([data-active-view="cesco-social"]):not([data-active-view="legal-registry"]) .brand-logo-img-wrap {
  display: flex;
}

.safe-registry-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.safe-registry-brand img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.cesco-official-logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid #BAE6FD;
  border-radius: 10px;
  padding: 4px 10px;
  box-shadow: 0 2px 8px rgba(0, 149, 217, 0.14);
  line-height: 0;
}

.cesco-official-logo-pill img {
  display: block;
  width: auto;
  object-fit: contain;
}

.cesco-topbar-mode-badge {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #38BDF8;
  background: rgba(0, 149, 217, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

html[data-theme="light"] .cesco-topbar-mode-badge {
  color: #0369A1;
  background: #E0F2FE;
  border-color: #7DD3FC;
}

#cs-gate-error {
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #991B1B !important;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
}

.cesco-form-row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .cesco-form-row2 {
    grid-template-columns: 1fr;
  }
}

.cesco-approval-pill {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #CBD5E1;
  box-shadow: 0 2px 6px rgba(15, 41, 66, 0.25);
}

.cesco-approval-pill.is-approved {
  border-color: #10B981;
  background: #ECFDF5;
}

.cesco-approval-pill.is-changes {
  border-color: #F59E0B;
  background: #FEF3C7;
}

.cesco-feed-first-comment {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  color: #0F2942;
  font-size: 11.5px;
  line-height: 1.4;
}

.cesco-client-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.cesco-client-step {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cesco-client-step strong {
  color: #0F2942;
  font-size: 12.5px;
}

.cesco-client-step span {
  color: #475569;
  font-size: 11.5px;
  line-height: 1.4;
}

.cesco-admin-vault-details {
  border: 1.5px dashed #93C5FD;
  background: #F8FBFF;
}

.cesco-vs-metricool-panel {
  border: 1px solid #BAE6FD;
  background: linear-gradient(135deg, #FFFFFF, #F0F9FF);
}

.cesco-vs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.cesco-vs-item {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cesco-vs-item strong {
  color: #0369A1;
  font-size: 12.5px;
}

.cesco-vs-item span {
  color: #334155;
  font-size: 11.5px;
  line-height: 1.4;
}

.cesco-bulk-csv-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px;
}

/* ============================================================================
   AISLAMIENTO EXTRA CESCO + MODAL GLOBAL NUEVO CLIENTE + BANNER DATOS HONESTOS
   ============================================================================ */
body[data-active-view="cesco-social"] #view-cesco-social > .area-id-bar,
body[data-active-view="cesco-social"] #sidebar-scene-navigator {
  display: none !important;
}

.cesco-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cesco-modal-card {
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: #FFFFFF;
  color: #0F2942;
  border: 2px solid #0095D9;
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(15, 41, 66, 0.35);
}

.cesco-honest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid #FDE68A;
  background: #FFFBEB;
  color: #78350F;
  font-size: 12.5px;
}

.cesco-honest-banner.is-real {
  border-color: #A7F3D0;
  background: #ECFDF5;
  color: #065F46;
}

.cesco-owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #E0F2FE;
  border: 1px solid #7DD3FC;
  color: #0369A1;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================================================
   UNIFICACION FIGMA ENTERPRISE (LIGHT + DARK) · CABECERA 2 FILAS · FINANZAS PROCREART · MOVIL
   ============================================================================ */
.topbar-row-primary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 6px 14px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 580px;
  min-width: 0;
  flex-wrap: wrap;
}

#cs-top-areas-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 460px;
  min-width: 0;
  flex-wrap: wrap;
  overflow-x: visible;
  padding: 2px 0;
}

#cs-top-areas-nav::-webkit-scrollbar {
  display: none;
}

.topbar-row-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 5px 14px;
}

.topbar-row2-context {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* MODO CLARO FIGMA CORPORATIVO (TEXTOS 100% LEGIBLES) */
html[data-theme="light"] body {
  background: #F8FAFC;
  color: #0F172A;
}

html[data-theme="light"] .topbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .topbar-row-utility {
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
}

html[data-theme="light"] .cs-top-area-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
}

html[data-theme="light"] .cs-top-area-btn:hover {
  background: #E0F2FE;
  border-color: #0284C7;
  color: #075985;
}

html[data-theme="light"] .cs-top-area-btn.active {
  background: #0369A1;
  border-color: #075985;
  color: #FFFFFF;
  box-shadow: 0 1px 4px rgba(3, 105, 161, 0.25);
}

html[data-theme="light"] #project-title-input {
  color: #0F172A !important;
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
}

html[data-theme="light"] #project-type-select {
  background: #FEF2F2 !important;
  border: 1px solid #FCA5A5 !important;
  color: #991B1B !important;
}

html[data-theme="light"] .topbar-company-badge {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  color: #0F172A;
}

html[data-theme="light"] .topbar-company-title strong,
html[data-theme="light"] .topbar-company-details strong {
  color: #0369A1;
}

html[data-theme="light"] .topbar-company-sub,
html[data-theme="light"] .topbar-company-details {
  color: #334155;
}

html[data-theme="light"] .dropdown-menu {
  background: #FFFFFF !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14) !important;
}

html[data-theme="light"] .dropdown-menu button {
  color: #0F172A !important;
  background: transparent;
}

html[data-theme="light"] .dropdown-menu button:hover {
  background: #F0F9FF !important;
  color: #0284C7 !important;
}

html[data-theme="light"] .sidebar-nav {
  background: #FFFFFF !important;
  border-right: 1px solid #E2E8F0;
  transition: none !important;
}

html[data-theme="light"] .cs-left-sub-btn,
html[data-theme="light"] .sidebar-nav .nav-item,
html[data-theme="light"] #cs-sidebar-context-nav .nav-item,
html[data-theme="light"] #cs-sidebar-context-nav .cs-left-sub-btn {
  color: #0F172A !important;
  transition: none !important;
}

html[data-theme="light"] .cs-left-sub-btn.active,
html[data-theme="light"] .sidebar-nav .nav-item.active,
html[data-theme="light"] #cs-sidebar-context-nav .nav-item.active,
html[data-theme="light"] #cs-sidebar-context-nav .cs-left-sub-btn.active {
  background: #E0F2FE !important;
  color: #0369A1 !important;
  border-color: #BAE6FD;
}

/* MODO OSCURO UNIFICADO + CONTRASTE ALTO EN TODAS LAS ÁREAS INCLUIDA CESCO */
html[data-theme="dark"] body,
html:not([data-theme="light"]) body.dark-mode {
  background: #0B1120;
  color: #F1F5F9;
}

html[data-theme="dark"] .topbar,
html:not([data-theme="light"]) body.dark-mode .topbar {
  background: #0F172A;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .topbar-row-utility,
html:not([data-theme="light"]) body.dark-mode .topbar-row-utility {
  background: #0B1324;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] .dropdown-menu,
html:not([data-theme="light"]) body.dark-mode .dropdown-menu {
  background: #0F172A !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  color: #F1F5F9 !important;
}

html[data-theme="dark"] .dropdown-menu button,
html:not([data-theme="light"]) body.dark-mode .dropdown-menu button {
  color: #E2E8F0 !important;
}

html[data-theme="dark"] #cs-top-areas-nav .cs-top-area-btn,
html:not([data-theme="light"]) body.dark-mode #cs-top-areas-nav .cs-top-area-btn {
  background: #1E293B !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  color: #F8FAFC !important;
}

html[data-theme="dark"] #cs-top-areas-nav .cs-top-area-btn:hover,
html:not([data-theme="light"]) body.dark-mode #cs-top-areas-nav .cs-top-area-btn:hover {
  background: #334155 !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] #cs-top-areas-nav .cs-top-area-btn.active,
html:not([data-theme="light"]) body.dark-mode #cs-top-areas-nav .cs-top-area-btn.active {
  background: #0369A1 !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] #btn-theme-toggle,
html:not([data-theme="light"]) body.dark-mode #btn-theme-toggle {
  background: #1E293B !important;
  color: #F8FAFC !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

html[data-theme="dark"] .topbar-company-badge,
html:not([data-theme="light"]) body.dark-mode .topbar-company-badge {
  background: #1E293B !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #F1F5F9 !important;
}

html[data-theme="dark"] .topbar-company-title,
html[data-theme="dark"] .topbar-company-title strong,
html:not([data-theme="light"]) body.dark-mode .topbar-company-title,
html:not([data-theme="light"]) body.dark-mode .topbar-company-title strong {
  color: #7DD3FC !important;
}

html[data-theme="dark"] #cs-sidebar-context-nav .nav-item,
html[data-theme="dark"] .cs-left-sub-btn,
html:not([data-theme="light"]) body.dark-mode #cs-sidebar-context-nav .nav-item,
html:not([data-theme="light"]) body.dark-mode .cs-left-sub-btn {
  color: #E2E8F0 !important;
}

html[data-theme="dark"] .cesco-suite-topbar,
html[data-theme="dark"] .cesco-panel,
html[data-theme="dark"] .cesco-kpi-card,
html[data-theme="dark"] .cesco-brand-card,
html[data-theme="dark"] .cesco-plan-card,
html[data-theme="dark"] .cesco-vs-item,
html[data-theme="dark"] .cesco-client-step,
html[data-theme="dark"] .cesco-quick-tile,
html[data-theme="dark"] .cesco-procreart-banner,
html[data-theme="dark"] .cesco-acc-row,
html[data-theme="dark"] .cesco-modal-card,
html[data-theme="dark"] .cesco-network-card,
html[data-theme="dark"] .cesco-net-chip,
html[data-theme="dark"] .cesco-inline-drawer,
html[data-theme="dark"] .cesco-channel-bar,
html[data-theme="dark"] .cesco-ch-pill,
html[data-theme="dark"] .cesco-subtab,
html[data-theme="dark"] .cesco-nav-pill,
html[data-theme="dark"] .cesco-ads-camp,
html[data-theme="dark"] .cesco-adset-box,
html[data-theme="dark"] .cesco-cal-cell,
html[data-theme="dark"] .cesco-bulk-csv-box,
html[data-theme="dark"] .cesco-inbox-item,
html[data-theme="dark"] .cesco-export-card,
html:not([data-theme="light"]) body.dark-mode .cesco-suite-topbar,
html:not([data-theme="light"]) body.dark-mode .cesco-panel,
html:not([data-theme="light"]) body.dark-mode .cesco-kpi-card,
html:not([data-theme="light"]) body.dark-mode .cesco-brand-card,
html:not([data-theme="light"]) body.dark-mode .cesco-plan-card,
html:not([data-theme="light"]) body.dark-mode .cesco-vs-item,
html:not([data-theme="light"]) body.dark-mode .cesco-client-step,
html:not([data-theme="light"]) body.dark-mode .cesco-quick-tile,
html:not([data-theme="light"]) body.dark-mode .cesco-procreart-banner,
html:not([data-theme="light"]) body.dark-mode .cesco-acc-row,
html:not([data-theme="light"]) body.dark-mode .cesco-modal-card,
html:not([data-theme="light"]) body.dark-mode .cesco-network-card,
html:not([data-theme="light"]) body.dark-mode .cesco-net-chip,
html:not([data-theme="light"]) body.dark-mode .cesco-inline-drawer,
html:not([data-theme="light"]) body.dark-mode .cesco-channel-bar,
html:not([data-theme="light"]) body.dark-mode .cesco-ch-pill,
html:not([data-theme="light"]) body.dark-mode .cesco-subtab,
html:not([data-theme="light"]) body.dark-mode .cesco-nav-pill,
html:not([data-theme="light"]) body.dark-mode .cesco-ads-camp,
html:not([data-theme="light"]) body.dark-mode .cesco-adset-box,
html:not([data-theme="light"]) body.dark-mode .cesco-cal-cell,
html:not([data-theme="light"]) body.dark-mode .cesco-bulk-csv-box,
html:not([data-theme="light"]) body.dark-mode .cesco-inbox-item,
html:not([data-theme="light"]) body.dark-mode .cesco-export-card {
  background: #111827 !important;
  color: #F1F5F9 !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

html[data-theme="dark"] .cesco-network-metrics,
html[data-theme="dark"] .cesco-network-metrics div,
html[data-theme="dark"] .cesco-calc-results div,
html[data-theme="dark"] .cesco-adset-box,
html:not([data-theme="light"]) body.dark-mode .cesco-network-metrics,
html:not([data-theme="light"]) body.dark-mode .cesco-network-metrics div,
html:not([data-theme="light"]) body.dark-mode .cesco-calc-results div,
html:not([data-theme="light"]) body.dark-mode .cesco-adset-box {
  background: #0F172A !important;
  color: #E2E8F0 !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

html[data-theme="dark"] .cesco-ad-leaf,
html:not([data-theme="light"]) body.dark-mode .cesco-ad-leaf {
  background: rgba(14, 165, 233, 0.18) !important;
  color: #E0F2FE !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .cesco-ad-leaf:hover,
html:not([data-theme="light"]) body.dark-mode .cesco-ad-leaf:hover {
  background: rgba(14, 165, 233, 0.32) !important;
  color: #FFFFFF !important;
  border-color: #38BDF8 !important;
}

html[data-theme="dark"] .cesco-adset-title,
html[data-theme="dark"] .cesco-adset-title strong,
html:not([data-theme="light"]) body.dark-mode .cesco-adset-title,
html:not([data-theme="light"]) body.dark-mode .cesco-adset-title strong {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .cesco-bubble.is-lead,
html:not([data-theme="light"]) body.dark-mode .cesco-bubble.is-lead {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

html[data-theme="dark"] .cesco-bubble.is-agent,
html:not([data-theme="light"]) body.dark-mode .cesco-bubble.is-agent {
  background: rgba(2, 132, 199, 0.24) !important;
  color: #E0F2FE !important;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

html[data-theme="dark"] .cesco-subtab.active,
html[data-theme="dark"] .cesco-nav-pill.active,
html[data-theme="dark"] .cesco-ch-pill.active,
html:not([data-theme="light"]) body.dark-mode .cesco-subtab.active,
html:not([data-theme="light"]) body.dark-mode .cesco-nav-pill.active,
html:not([data-theme="light"]) body.dark-mode .cesco-ch-pill.active {
  background: #0369A1 !important;
  color: #FFFFFF !important;
  border-color: #38BDF8 !important;
}

html[data-theme="dark"] .cesco-btn-ghost,
html:not([data-theme="light"]) body.dark-mode .cesco-btn-ghost {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
}

html[data-theme="dark"] .cesco-panel h3,
html[data-theme="dark"] .cesco-kpi-value,
html[data-theme="dark"] .cesco-suite-workspace-name,
html[data-theme="dark"] .cesco-table strong,
html[data-theme="dark"] .cesco-figma-audit-row strong,
html[data-theme="dark"] .cesco-audit-left strong,
html[data-theme="dark"] .cesco-network-top strong,
html[data-theme="dark"] .cesco-network-metrics strong,
html[data-theme="dark"] .cesco-calc-results strong,
html:not([data-theme="light"]) body.dark-mode .cesco-panel h3,
html:not([data-theme="light"]) body.dark-mode .cesco-kpi-value,
html:not([data-theme="light"]) body.dark-mode .cesco-suite-workspace-name,
html:not([data-theme="light"]) body.dark-mode .cesco-table strong,
html:not([data-theme="light"]) body.dark-mode .cesco-figma-audit-row strong,
html:not([data-theme="light"]) body.dark-mode .cesco-audit-left strong,
html:not([data-theme="light"]) body.dark-mode .cesco-network-top strong,
html:not([data-theme="light"]) body.dark-mode .cesco-network-metrics strong,
html:not([data-theme="light"]) body.dark-mode .cesco-calc-results strong {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .cesco-panel p,
html[data-theme="dark"] .cesco-kpi-label,
html[data-theme="dark"] .cesco-kpi-delta,
html[data-theme="dark"] .cesco-table td,
html[data-theme="dark"] .cesco-table th,
html[data-theme="dark"] .cesco-procreart-meta span,
html[data-theme="dark"] .cesco-network-top small,
html[data-theme="dark"] .cesco-network-metrics span,
html[data-theme="dark"] .cesco-label,
html[data-theme="dark"] .cesco-calc-results span,
html[data-theme="dark"] .cesco-audit-item p,
html[data-theme="dark"] .cesco-audit-left small,
html[data-theme="dark"] .cesco-client-step span,
html:not([data-theme="light"]) body.dark-mode .cesco-panel p,
html:not([data-theme="light"]) body.dark-mode .cesco-kpi-label,
html:not([data-theme="light"]) body.dark-mode .cesco-kpi-delta,
html:not([data-theme="light"]) body.dark-mode .cesco-table td,
html:not([data-theme="light"]) body.dark-mode .cesco-table th,
html:not([data-theme="light"]) body.dark-mode .cesco-procreart-meta span,
html:not([data-theme="light"]) body.dark-mode .cesco-network-top small,
html:not([data-theme="light"]) body.dark-mode .cesco-network-metrics span,
html:not([data-theme="light"]) body.dark-mode .cesco-label,
html:not([data-theme="light"]) body.dark-mode .cesco-calc-results span,
html:not([data-theme="light"]) body.dark-mode .cesco-audit-item p,
html:not([data-theme="light"]) body.dark-mode .cesco-audit-left small,
html:not([data-theme="light"]) body.dark-mode .cesco-client-step span {
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .cesco-client-step strong,
html:not([data-theme="light"]) body.dark-mode .cesco-client-step strong {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .cesco-input,
html[data-theme="dark"] .cesco-select,
html[data-theme="dark"] .cesco-textarea,
html:not([data-theme="light"]) body.dark-mode .cesco-input,
html:not([data-theme="light"]) body.dark-mode .cesco-select,
html:not([data-theme="light"]) body.dark-mode .cesco-textarea {
  background: #0F172A !important;
  color: #F8FAFC !important;
  border-color: rgba(148, 163, 184, 0.34) !important;
}

html[data-theme="dark"] .cesco-ai-rec-card,
html[data-theme="dark"] .cesco-tone-box,
html[data-theme="dark"] .cesco-feed-first-comment,
html:not([data-theme="light"]) body.dark-mode .cesco-ai-rec-card,
html:not([data-theme="light"]) body.dark-mode .cesco-tone-box,
html:not([data-theme="light"]) body.dark-mode .cesco-feed-first-comment {
  background: rgba(14, 165, 233, 0.14) !important;
  border-color: rgba(56, 189, 248, 0.36) !important;
  color: #E0F2FE !important;
}

html[data-theme="dark"] .cesco-procreart-logo-pill,
html:not([data-theme="light"]) body.dark-mode .cesco-procreart-logo-pill {
  background: #FFFFFF;
  padding: 4px 10px;
  border-radius: 8px;
}

/* PANEL DERECHO DE GUION COMPACTO Y AGRUPADO */
.cs-drawer-compact-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-rev-drawer-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-rev-drawer-row label {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
}

.cs-drawer-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.cs-drawer-btn-grid .btn {
  justify-content: center;
  font-size: 11px;
  padding: 5px 6px;
  white-space: nowrap;
}

/* COMPONENTES FIGMA CESCO & FINANZAS PROCREART */
.cesco-figma-audit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cesco-figma-audit-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.cesco-figma-audit-row:hover {
  border-color: #0284C7;
}

html[data-theme="dark"] .cesco-figma-audit-row,
html:not([data-theme="light"]) body.dark-mode .cesco-figma-audit-row {
  background: #0F172A !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}

.cesco-audit-left {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.cesco-audit-left strong {
  display: block;
  font-size: 12px;
  color: #0F172A;
}

.cesco-audit-left small {
  display: block;
  font-size: 11px;
  color: #64748B;
}

.cesco-audit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.cesco-audit-badge.is-ok { background: #DCFCE7; color: #047857; }
.cesco-audit-badge.is-warn { background: #FEF3C7; color: #B45309; }
.cesco-audit-badge.is-info { background: #E0F2FE; color: #0369A1; }
.cesco-audit-badge.is-bad { background: #FEE2E2; color: #B91C1C; }

.cesco-impact-chip {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: #E2E8F0;
  color: #334155;
  white-space: nowrap;
}

.cesco-funnel-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.cesco-funnel-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.cesco-funnel-track {
  height: 10px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}

.cesco-funnel-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.cesco-ai-rec-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  color: #0F2942;
}

.cesco-ai-rec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 12.5px;
  color: #0284C7;
  margin-bottom: 4px;
}

.cesco-ai-rec-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.cesco-procreart-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #FFFFFF, #F0F9FF);
  border: 1.5px solid #BAE6FD;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.cesco-procreart-issuer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.cesco-procreart-logo-pill {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.cesco-procreart-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.cesco-procreart-meta strong {
  font-size: 13px;
  color: #0F172A;
}

.cesco-procreart-meta span {
  color: #475569;
  font-size: 11.5px;
}

.cesco-procreart-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cesco-finance-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px;
}

.cesco-accounting-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cesco-acc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 12.5px;
}

.cesco-acc-row.is-total {
  background: #F0F9FF;
  border-color: #7DD3FC;
  font-size: 13.5px;
  font-weight: 800;
}

.cesco-hr {
  border: none;
  border-top: 1px dashed #CBD5E1;
  margin: 6px 0;
}

.cesco-form-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cesco-empty-box {
  padding: 18px;
  text-align: center;
  border: 1px dashed #CBD5E1;
  border-radius: 10px;
  color: #64748B;
  font-size: 12.5px;
}

.cesco-status-select {
  font-weight: 700;
  font-size: 11.5px;
}

.cesco-status-pill.is-linked {
  background: #E0F2FE;
  color: #0369A1;
  border-color: #7DD3FC;
}

#cs-modal-subscriptions-admin .btn-ghost {
  color: #F8FAFC !important;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

@media (max-width: 640px) {
  .topbar-row-primary {
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
  }
  #cs-cesco-topbar-brand {
    flex-wrap: wrap !important;
    max-width: 100%;
  }
  .topbar-brand {
    flex: 1 1 100% !important;
    width: 100% !important;
    order: 2 !important;
  }
  #cs-topbar-user-profile-wrap {
    width: auto !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    order: 1 !important;
    margin-left: auto !important;
  }
  .cs-user-pill-btn {
    padding: 2px 8px 2px 3px !important;
  }
  .cs-user-pill-meta strong {
    max-width: 112px !important;
    font-size: 11px !important;
  }
  .cs-top-area-btn {
    padding: 4px 7px !important;
    font-size: 10.5px !important;
  }
}

.hf-gw-instructions-box {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.42);
  color: #E2E8F0;
  font-size: 12px;
}

.hf-gw-guide-title {
  font-weight: 900;
  color: #7DD3FC;
  font-size: 12.5px;
  margin-bottom: 6px;
}

.hf-gw-guide-steps {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

.hf-gw-guide-steps code {
  color: #FDE68A;
  font-weight: 800;
}

/* ============================================================================
   ADAPTABILIDAD MÓVIL Y TABLET (RESPONSIVE PORTAL + GUION + CESCO + PORTAL PAGO)
   ============================================================================ */
@media (max-width: 980px) {
  .topbar-row-primary {
    flex-wrap: wrap;
    padding: 6px 10px;
    gap: 6px 8px;
  }
  .topbar-brand {
    flex: 1 1 100%;
    width: 100%;
    flex-wrap: wrap;
    gap: 6px 8px;
  }
  #cs-top-areas-nav {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    gap: 4px;
    padding-top: 4px;
  }
  #cs-topbar-user-profile-wrap {
    order: 2;
    margin-left: auto;
    flex-shrink: 0;
    max-width: 100%;
  }
  .topbar-row-utility {
    padding: 6px 10px;
  }
  .cesco-two-col {
    grid-template-columns: 1fr !important;
  }
  .cesco-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .hf-portal-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .hf-signup-inputs {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .app-layout {
    flex-direction: column !important;
  }
  .sidebar-nav {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    max-height: 220px;
    border-right: none !important;
    border-bottom: 1px solid #E2E8F0;
  }
  .script-workspace-body {
    flex-direction: column !important;
  }
  #script-right-tools-drawer {
    width: 100% !important;
    max-width: 100% !important;
    border-left: none !important;
    border-top: 1px solid #E2E8F0;
  }
  .cesco-kpi-grid,
  .cesco-plans-grid,
  .hf-portal-tabs,
  .hf-gw-grid,
  .hf-login-grid {
    grid-template-columns: 1fr !important;
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .cesco-suite-topbar {
    flex-direction: column;
    align-items: flex-start !important;
  }
}

/* ============================================================================
   CESCO DARK MODE SHELL + FIDELIDAD VISUAL FIGMA (DASHBOARD & SIDEBAR CLEAN)
   ============================================================================ */
html[data-theme="dark"] #view-cesco-social,
html[data-theme="dark"] .cesco-suite-shell,
html:not([data-theme="light"]) body.dark-mode #view-cesco-social,
html:not([data-theme="light"]) body.dark-mode .cesco-suite-shell {
  background: #0B1120 !important;
  color: #F1F5F9 !important;
}

html[data-theme="dark"] .cesco-pills-nav,
html[data-theme="dark"] .cesco-oauth-config-box,
html:not([data-theme="light"]) body.dark-mode .cesco-pills-nav,
html:not([data-theme="light"]) body.dark-mode .cesco-oauth-config-box {
  background: #111827 !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  color: #F1F5F9 !important;
}

html[data-theme="dark"] .cesco-ctrl-group label,
html:not([data-theme="light"]) body.dark-mode .cesco-ctrl-group label {
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .cesco-honest-banner,
html[data-theme="dark"] .cesco-oauth-status-banner,
html:not([data-theme="light"]) body.dark-mode .cesco-honest-banner,
html:not([data-theme="light"]) body.dark-mode .cesco-oauth-status-banner {
  background: rgba(14, 165, 233, 0.14) !important;
  border-color: rgba(56, 189, 248, 0.36) !important;
  color: #E0F2FE !important;
}

html[data-theme="dark"] .cesco-oauth-status-banner.is-local-dev,
html:not([data-theme="light"]) body.dark-mode .cesco-oauth-status-banner.is-local-dev {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(251, 191, 36, 0.38) !important;
  color: #FDE68A !important;
}

html[data-theme="dark"] .cesco-oauth-status-banner.is-real,
html:not([data-theme="light"]) body.dark-mode .cesco-oauth-status-banner.is-real {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(52, 211, 153, 0.4) !important;
  color: #A7F3D0 !important;
}

/* Figma Cesco Left Sidebar Clean Monoline Aesthetic */
body[data-active-view="cesco-social"] .cs-meta-chip,
body[data-active-view="cesco-social"] .cs-sidebar-area-meta {
  display: none !important;
}

body[data-active-view="cesco-social"] #cs-sidebar-context-nav .nav-item {
  border-radius: 10px !important;
  border: 1px solid transparent !important;
  padding: 7px 10px !important;
  font-weight: 600 !important;
  transition: none !important;
}

html[data-theme="light"] body[data-active-view="cesco-social"] #cs-sidebar-context-nav .nav-item:not(.active),
[data-theme="light"] body[data-active-view="cesco-social"] #cs-sidebar-context-nav .nav-item:not(.active) {
  color: #0F172A !important;
}

body[data-active-view="cesco-social"] #cs-sidebar-context-nav .nav-item .nav-badge {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit !important;
  opacity: 0.56 !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  padding: 0 !important;
}

html[data-theme="light"] body[data-active-view="cesco-social"] #cs-sidebar-context-nav .nav-item.active,
[data-theme="light"] body[data-active-view="cesco-social"] #cs-sidebar-context-nav .nav-item.active {
  background: #F0F9FF !important;
  color: #0284C7 !important;
  border: 1px solid #38BDF8 !important;
}

html[data-theme="dark"] body[data-active-view="cesco-social"] #cs-sidebar-context-nav .nav-item.active {
  background: rgba(14, 165, 233, 0.16) !important;
  color: #7DD3FC !important;
  border: 1px solid rgba(56, 189, 248, 0.55) !important;
}

@media (min-width: 1120px) {
  .cesco-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.cesco-figma-headbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 2px 6px;
}

.cesco-figma-eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0284C7;
  margin-bottom: 2px;
}

.cesco-figma-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0F172A;
}

html[data-theme="dark"] .cesco-figma-title {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .cesco-figma-eyebrow {
  color: #38BDF8 !important;
}

.cesco-kpi-val-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cesco-kpi-value.is-accent {
  color: #0284C7;
}

html[data-theme="dark"] .cesco-kpi-value.is-accent {
  color: #38BDF8 !important;
}

.cesco-pill-delta {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #F1F5F9;
  color: #475569;
}

.cesco-pill-delta.is-up {
  background: #ECFDF5;
  color: #047857;
}

.cesco-pill-delta.is-blue {
  background: #E0F2FE;
  color: #0369A1;
}

html[data-theme="dark"] .cesco-pill-delta {
  background: #1E293B !important;
  color: #CBD5E1 !important;
}

html[data-theme="dark"] .cesco-pill-delta.is-up {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #6EE7B7 !important;
}

html[data-theme="dark"] .cesco-pill-delta.is-blue {
  background: rgba(14, 165, 233, 0.2) !important;
  color: #7DD3FC !important;
}

.cesco-pill-blue {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  color: #0369A1;
  white-space: nowrap;
}

html[data-theme="dark"] .cesco-pill-blue {
  background: rgba(14, 165, 233, 0.18) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  color: #7DD3FC !important;
}

.cesco-funnel-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.cesco-funnel-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}

.cesco-funnel-track {
  height: 8px;
  border-radius: 999px;
  background: #E2E8F0;
  overflow: hidden;
}

html[data-theme="dark"] .cesco-funnel-track {
  background: #1E293B !important;
}

.cesco-funnel-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* ============================================================================
   SUBMENÚ 01-GUION ARRIBA JUNTO AL NOMBRE DE PROYECTO (SIN PANEL 01 IZQUIERDO)
   ============================================================================ */
body[data-active-area="guion"] #cs-sidebar-nav .sidebar-top-controls,
body[data-active-area="guion"] #cs-sidebar-nav .nav-list {
  display: none !important;
}
body[data-active-area="guion"]:not([data-active-view="script"]) #cs-sidebar-nav {
  display: none !important;
}
body[data-active-view="script"] #cs-sidebar-nav {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
}
body[data-active-view="script"].cs-left-sidebar-hidden #cs-sidebar-nav,
body.cs-left-sidebar-hidden #cs-sidebar-nav {
  display: none !important;
}
body[data-active-view="script"] #sidebar-scene-navigator {
  flex: 1 1 auto !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  border-bottom: none !important;
  overflow: hidden !important;
}
body[data-active-view="script"] #sidebar-scene-navigator.is-collapsed {
  flex: 0 0 auto !important;
  height: auto !important;
}
body[data-active-view="script"] #sidebar-scene-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
}
.cs-guion-top-script-tools {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap !important;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: visible !important;
}
.cs-guion-top-script-tools .btn,
.cs-guion-top-script-tools .dropdown > .btn {
  padding: 3px 6px !important;
  font-size: 10.5px !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  flex-shrink: 0;
}
.topbar-row-utility {
  flex-wrap: wrap !important;
  overflow: visible !important;
  gap: 6px 12px !important;
  min-height: 36px;
  align-items: center !important;
}
body[data-active-area="guion"] #cs-area-context-bar {
  overflow: visible !important;
  height: auto !important;
  min-height: 34px !important;
  padding: 3px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
}
body[data-active-area="guion"] #cs-area-context-bar .cs-context-ribbon-left,
body[data-active-area="guion"] #btn-toggle-guion-top-submenu,
body[data-active-area="guion"]:not([data-active-view="theater"]) #cs-area-context-bar .topbar-center {
  display: none !important;
}
body[data-active-view="script"] #script-compact-topbar {
  padding: 2px 12px !important;
  min-height: 0 !important;
  justify-content: flex-end !important;
}
#cs-hover-tooltip-card {
  position: fixed;
  z-index: 250000;
  pointer-events: none;
  max-width: 310px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #0F172A;
  color: #F8FAFC;
  border: 1px solid #38BDF8;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.55);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.38;
  white-space: normal;
  display: none;
}

.cs-guion-top-submenu {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap !important;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  overflow: visible !important;
}
.cs-guion-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0F172A;
  white-space: nowrap;
}
.cs-guion-top-badge:hover {
  border-color: #0284C7;
  color: #0284C7;
}
html[data-theme="dark"] .cs-guion-top-badge,
html:not([data-theme="light"]) body.dark-mode .cs-guion-top-badge {
  background: #1E293B;
  border-color: #334155;
  color: #F8FAFC;
}
body[data-active-area="guion"] .cs-guion-top-badge {
  background: linear-gradient(135deg, #0284C7, #0369A1);
  border-color: #38BDF8;
  color: #FFFFFF;
}
body[data-active-area="guion"] .cs-guion-top-badge .cs-guion-chev {
  display: none;
}
.cs-guion-top-submenu-body {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap !important;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  overflow: visible !important;
}
body:not([data-active-area="guion"]) .cs-guion-top-submenu-body {
  display: none;
}
body:not([data-active-area="guion"]) .cs-guion-top-submenu.is-open .cs-guion-top-submenu-body {
  display: flex;
  flex-wrap: wrap !important;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1200;
  width: auto;
  min-width: min(92vw, 760px);
  padding: 10px 12px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
}
html[data-theme="dark"] body:not([data-active-area="guion"]) .cs-guion-top-submenu.is-open .cs-guion-top-submenu-body,
html:not([data-theme="light"]) body.dark-mode:not([data-active-area="guion"]) .cs-guion-top-submenu.is-open .cs-guion-top-submenu-body {
  background: #0F172A;
  border-color: #334155;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
}
.cs-guion-top-views-strip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap !important;
  flex: 1 1 auto;
  min-width: 140px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cs-guion-top-views-strip::-webkit-scrollbar {
  display: none;
}
.cs-guion-top-item {
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  padding: 3px 6px !important;
  margin: 0 !important;
  border-radius: 7px !important;
  font-size: 10.5px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid #CBD5E1 !important;
  background: #FFFFFF !important;
  color: #1E293B !important;
  transition: none !important;
}
.cs-guion-top-item:hover {
  background: #F0F9FF !important;
  border-color: #7DD3FC !important;
  color: #0369A1 !important;
}
.cs-guion-top-item.active {
  background: #0284C7 !important;
  border-color: #0284C7 !important;
  color: #FFFFFF !important;
}
.cs-guion-top-item .nav-badge {
  font-size: 9px !important;
  padding: 1px 5px !important;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.12);
  color: inherit;
}
.cs-guion-top-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.24);
  color: #FFFFFF;
}
html[data-theme="dark"] .cs-guion-top-item,
html:not([data-theme="light"]) body.dark-mode .cs-guion-top-item {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #E2E8F0 !important;
}
html[data-theme="dark"] .cs-guion-top-item:hover,
html:not([data-theme="light"]) body.dark-mode .cs-guion-top-item:hover {
  background: #334155 !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .cs-guion-top-item.active,
html:not([data-theme="light"]) body.dark-mode .cs-guion-top-item.active {
  background: #0284C7 !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
}
.cs-guion-top-sep {
  width: 1px;
  height: 20px;
  background: #CBD5E1;
  margin: 0 3px;
}
html[data-theme="dark"] .cs-guion-top-sep,
html:not([data-theme="light"]) body.dark-mode .cs-guion-top-sep {
  background: #334155;
}

.cs-privacy-mon-title-ok {
  color: #065F46;
}
.cs-privacy-mon-title-warn {
  color: #991B1B;
}
.cs-privacy-mon-btn-sec {
  background: #065F46 !important;
  border: 1px solid #047857 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
}
html[data-theme="dark"] .cs-privacy-mon-title-ok,
html:not([data-theme="light"]) body.dark-mode .cs-privacy-mon-title-ok {
  color: #6EE7B7 !important;
}
html[data-theme="dark"] .cs-privacy-mon-title-warn,
html:not([data-theme="light"]) body.dark-mode .cs-privacy-mon-title-warn {
  color: #FCA5A5 !important;
}
html[data-theme="dark"] .cs-privacy-mon-btn-sec,
html:not([data-theme="light"]) body.dark-mode .cs-privacy-mon-btn-sec {
  background: rgba(16, 185, 129, 0.22) !important;
  border: 1px solid #10B981 !important;
  color: #6EE7B7 !important;
}

/* ============================================================================
   HUB / INICIO CON IDENTIDAD VISUAL, TIPOGRAFÍA Y ENTORNO DE CESCO SOCIAL SUITE
   ============================================================================ */
#view-dashboard,
#view-dashboard .dashboard-container {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#view-dashboard {
  background: #0B1120;
  color: #F1F5F9;
}
html[data-theme="light"] #view-dashboard {
  background: #F8FAFC !important;
  color: #0F2942 !important;
}

html[data-theme="light"] #view-dashboard .dashboard-header-banner {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 10px rgba(15, 41, 66, 0.04) !important;
  color: #0F2942 !important;
}
html[data-theme="light"] #view-dashboard .dashboard-header-logo {
  border: 1px solid #BAE6FD !important;
  box-shadow: 0 2px 8px rgba(0, 149, 217, 0.14) !important;
}
html[data-theme="light"] #view-dashboard .dashboard-badge-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: #E0F2FE !important;
  color: #005596 !important;
  border: 1px solid #BAE6FD !important;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
html[data-theme="light"] #view-dashboard .dashboard-title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #0F2942 !important;
}
html[data-theme="light"] #view-dashboard #dash-quick-tools-bar,
html[data-theme="light"] #view-dashboard .dash-kpi-card,
html[data-theme="light"] #view-dashboard .dash-module-card,
html[data-theme="light"] #view-dashboard .dash-access-panel,
html[data-theme="light"] #view-dashboard .dashboard-corporate-card,
html[data-theme="light"] #view-dashboard #cs-sec1-projects-history-packages {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(15, 41, 66, 0.03) !important;
  color: #0F2942 !important;
}
html[data-theme="light"] #view-dashboard .dash-kpi-card:hover,
html[data-theme="light"] #view-dashboard .dash-module-card:hover {
  border-color: #0095D9 !important;
  box-shadow: 0 6px 18px rgba(0, 149, 217, 0.12) !important;
}
html[data-theme="light"] #view-dashboard .dash-kpi-label {
  color: #64748B !important;
  font-weight: 800 !important;
}
html[data-theme="light"] #view-dashboard .dash-kpi-val {
  color: #0F2942 !important;
  font-size: 22px !important;
  font-weight: 800 !important;
}
html[data-theme="light"] #view-dashboard .dash-section-title,
html[data-theme="light"] #view-dashboard .dash-mod-title {
  color: #0F2942 !important;
  font-weight: 800 !important;
}
html[data-theme="light"] #view-dashboard .btn-primary,
html[data-theme="light"] #view-dashboard .dashboard-header-cta .btn-primary {
  background: linear-gradient(135deg, #0095D9, #005596) !important;
  border-color: #0077B6 !important;
  color: #FFFFFF !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0, 149, 217, 0.22) !important;
}
html[data-theme="light"] #view-dashboard .btn-secondary {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F2942 !important;
  border-radius: 8px !important;
}

/* MODO OSCURO HUB / INICIO HERMANADO CON CESCO DARK SHELL */
html[data-theme="dark"] #view-dashboard .dashboard-header-banner,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dashboard-header-banner {
  background: #131C31 !important;
  border: 1px solid #1E293B !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
}
html[data-theme="dark"] #view-dashboard .dashboard-header-logo,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dashboard-header-logo {
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 2px 10px rgba(0, 149, 217, 0.24) !important;
}
html[data-theme="dark"] #view-dashboard .dashboard-badge-pill,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dashboard-badge-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16) !important;
  color: #38BDF8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}
html[data-theme="dark"] #view-dashboard .dashboard-title,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dashboard-title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #F8FAFC !important;
}
html[data-theme="dark"] #view-dashboard #dash-quick-tools-bar,
html[data-theme="dark"] #view-dashboard .dash-kpi-card,
html[data-theme="dark"] #view-dashboard .dash-module-card,
html[data-theme="dark"] #view-dashboard .dash-access-panel,
html[data-theme="dark"] #view-dashboard .dashboard-corporate-card,
html[data-theme="dark"] #view-dashboard #cs-sec1-projects-history-packages,
html:not([data-theme="light"]) body.dark-mode #view-dashboard #dash-quick-tools-bar,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dash-kpi-card,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dash-module-card,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dash-access-panel,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dashboard-corporate-card,
html:not([data-theme="light"]) body.dark-mode #view-dashboard #cs-sec1-projects-history-packages {
  background: #131C31 !important;
  border: 1px solid #1E293B !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
  color: #F1F5F9 !important;
}
html[data-theme="dark"] #view-dashboard .dash-kpi-card:hover,
html[data-theme="dark"] #view-dashboard .dash-module-card:hover,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dash-kpi-card:hover,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dash-module-card:hover {
  border-color: #38BDF8 !important;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.14) !important;
}
html[data-theme="dark"] #view-dashboard .dash-kpi-val,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dash-kpi-val {
  color: #F8FAFC !important;
  font-size: 22px !important;
  font-weight: 800 !important;
}
html[data-theme="dark"] #view-dashboard .dash-kpi-label,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dash-kpi-label {
  color: #94A3B8 !important;
  font-weight: 800 !important;
}
html[data-theme="dark"] #view-dashboard .dashboard-header-cta .btn-primary,
html:not([data-theme="light"]) body.dark-mode #view-dashboard .dashboard-header-cta .btn-primary {
  background: linear-gradient(135deg, #0095D9, #0284C7) !important;
  border-color: #38BDF8 !important;
  color: #FFFFFF !important;
  border-radius: 8px !important;
}


/* ============================================================================
   CONTRASTE DE BOTONES EN MODO CLARO (WCAG AA) — CABECERA, SUBMENÚ GUION Y PANELES
   ============================================================================ */
html[data-theme="light"] #cs-area-context-bar,
html[data-theme="light"] .topbar-row-utility,
html[data-theme="light"] #script-compact-topbar {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2E8F0 !important;
}
html[data-theme="light"] .btn:not(.btn-primary):not(.btn-accent):not(.btn-danger):not(.cs-top-area-btn):not(.cs-guion-top-item):not([style*="background"]) {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #94A3B8 !important;
}
html[data-theme="light"] .btn:not(.btn-primary):not(.btn-accent):not(.btn-danger):not(.cs-top-area-btn):not(.cs-guion-top-item):not([style*="background"]):hover {
  background: #E0F2FE !important;
  color: #075985 !important;
  border-color: #0284C7 !important;
}
html[data-theme="light"] .btn-ghost.active,
html[data-theme="light"] .btn.active:not(.cs-guion-top-item) {
  background: #E0F2FE !important;
  color: #075985 !important;
  border-color: #0284C7 !important;
}
html[data-theme="light"] .btn-primary {
  background: #0369A1 !important;
  color: #FFFFFF !important;
  border: 1px solid #075985 !important;
}
html[data-theme="light"] .btn-primary:hover {
  background: #075985 !important;
}
html[data-theme="light"] .btn-accent {
  background: linear-gradient(135deg, #6D28D9, #BE185D) !important;
  color: #FFFFFF !important;
  border: 1px solid #5B21B6 !important;
}
html[data-theme="light"] .btn[style*="background"] {
  color: #FFFFFF !important;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.35);
}
html[data-theme="light"] .cs-guion-top-item {
  border-color: #94A3B8 !important;
  color: #0F172A !important;
}
html[data-theme="light"] .cs-guion-top-item.active {
  background: #0369A1 !important;
  border-color: #075985 !important;
  color: #FFFFFF !important;
}
html[data-theme="light"] .cs-guion-top-sep {
  background: #94A3B8;
}
html[data-theme="light"] .btn:disabled,
html[data-theme="light"] .btn[disabled] {
  background: #F1F5F9 !important;
  color: #64748B !important;
  border-color: #CBD5E1 !important;
  cursor: not-allowed;
}
html[data-theme="light"] .btn:focus-visible,
html[data-theme="light"] .cs-top-area-btn:focus-visible,
html[data-theme="light"] .dropdown-menu button:focus-visible {
  outline: 2px solid #0284C7 !important;
  outline-offset: 2px;
}

.set-mode-host { display:flex; flex:1; min-height:0; overflow:hidden; background:var(--bg-main); }
#set-mode-root {
  --set-bg: var(--bg-app, #111215);
  --set-card: var(--bg-panel, #191b20);
  --set-raised: var(--bg-card, #23262e);
  --set-text: var(--text-main, #f8fafc);
  --set-muted: var(--text-muted, #9ca3af);
  --set-line: var(--border-color, #323642);
  --set-accent: var(--accent-primary, #d62828);
  --set-status-good: #22c55e;
  --set-status-warning: #f59e0b;
  --set-status-error: #ef4444;
  --set-focus: #38bdf8;
  position: relative;
  z-index: auto;
  display: grid;
  flex: 1;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 100%;
  min-height: 0;
  color: var(--set-text);
  background: var(--set-bg);
  font-family: "Segoe UI", system-ui, sans-serif;
  padding: 0;
}
#set-mode-root[data-set-theme="solar"] {
  --set-bg: #f4f7fb;
  --set-card: #ffffff;
  --set-raised: #e8eef5;
  --set-text: #142033;
  --set-muted: #526174;
  --set-line: #c6d0dc;
  --set-accent: #b91c1c;
  --set-status-good: #047857;
  --set-status-warning: #92400e;
  --set-status-error: #b91c1c;
  --set-focus: #005596;
}
#set-mode-root[data-set-theme="dark"] {
  --set-bg: #111215;
  --set-card: #191b20;
  --set-raised: #23262e;
  --set-text: #f8fafc;
  --set-muted: #9ca3af;
  --set-line: #323642;
  --set-accent: #d62828;
  --set-status-good: #22c55e;
  --set-status-warning: #f59e0b;
  --set-status-error: #ef4444;
  --set-focus: #38bdf8;
}
.set-mode-header { display:flex; align-items:center; gap:16px; padding:12px 20px; border-top:3px solid var(--set-accent); border-bottom:1px solid var(--set-line); background:var(--set-card); box-shadow:0 6px 20px rgba(0,0,0,.08); }
.set-mode-title { display:flex; flex-direction:column; min-width:150px; }
.set-mode-title strong { color:var(--set-accent); letter-spacing:.12em; font-size:12px; }
.set-mode-title span { max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--set-muted); font-size:12px; }
.set-mode-day { display:flex; flex-direction:column; gap:3px; flex:1; max-width:420px; color:var(--set-muted); font-size:11px; }
.set-mode-day select, #set-mode-root select, #set-mode-root input, #set-mode-root textarea { min-height:44px; border:1px solid var(--set-line); border-radius:8px; padding:8px 11px; color:var(--set-text); background:var(--set-bg); font:inherit; }
.set-mode-live { display:flex; flex-direction:column; align-items:center; min-width:110px; font-variant-numeric:tabular-nums; }
.set-mode-live time { font-size:20px; font-weight:800; }
.set-mode-live span { color:var(--set-muted); font-size:11px; }
.set-mode-header-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.set-mode-action, .set-secondary-button, .set-primary-button { min-height:46px; border:1px solid var(--set-line); border-radius:9px; padding:9px 14px; color:var(--set-text); background:var(--set-raised); font:inherit; font-weight:700; cursor:pointer; transition:background-color .15s ease, border-color .15s ease, transform .15s ease; }
.set-mode-action:hover, .set-secondary-button:hover, .set-primary-button:hover { border-color:var(--set-accent); transform:translateY(-1px); }
.set-mode-fullscreen-toggle { border-color:var(--set-accent); }
.set-mode-exit { color:#fff; border-color:#b91c1c; background:#b91c1c; }
.set-mode-exit:hover { color:#fff; background:#991b1b; }
.set-mode-connection { color:var(--set-status-good); font-size:11px; white-space:nowrap; }
.set-mode-connection[data-state="pending"] { color:var(--set-status-warning); }
.set-mode-connection[data-state="offline"] { color:var(--set-status-error); }
.set-mode-main { min-height:0; overflow:auto; padding:clamp(12px, 2.5vw, 30px); }
#set-mode-content { max-width:1120px; margin:0 auto; }
.set-card { border:1px solid var(--set-line); border-radius:16px; padding:clamp(16px, 3vw, 28px); background:var(--set-card); box-shadow:0 12px 30px rgba(0,0,0,.12); }
.set-section-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.set-section-heading h1 { margin:3px 0 0; font-size:clamp(22px, 3vw, 32px); }
.set-eyebrow { color:var(--set-accent); font-size:11px; font-weight:800; letter-spacing:.1em; }
.set-pill { border:1px solid var(--set-line); border-radius:999px; padding:7px 12px; color:var(--set-muted); font-size:12px; }
.set-form-grid { display:grid; grid-template-columns:2fr 1fr 1fr; gap:12px; }
.set-form-grid label, .set-reason-label, .set-note-form label, .set-assignee-field { display:flex; flex-direction:column; gap:6px; color:var(--set-muted); font-size:12px; font-weight:700; }
.set-assignee-field { max-width:420px; margin:0 0 14px; }
.set-timer { margin:18px 0 10px; text-align:center; font:800 clamp(44px, 9vw, 82px)/1.1 ui-monospace, Consolas, monospace; font-variant-numeric:tabular-nums; }
.set-action-button { display:block; width:min(100%, 560px); min-height:100px; margin:0 auto 12px; border:0; border-radius:16px; color:#fff; background:#15803d; font-size:clamp(28px, 5vw, 42px); font-weight:900; letter-spacing:.04em; cursor:pointer; touch-action:manipulation; }
.set-action-button.cut { background:#b91c1c; }
.set-take-meta { min-height:24px; margin:10px 0 16px; color:var(--set-muted); text-align:center; font-size:13px; }
.set-reason-label { max-width:420px; margin:0 auto 18px; }
.set-rating-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; }
.set-rating { min-height:74px; border:1px solid transparent; border-radius:12px; color:#fff; font-size:clamp(16px, 2.5vw, 22px); font-weight:900; cursor:pointer; touch-action:manipulation; }
.set-rating.good { background:#047857; } .set-rating.hold { background:#b45309; } .set-rating.bad { background:#b91c1c; }
.set-card-actions { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:10px; margin-top:18px; }
.set-card-actions span { color:var(--set-muted); font-size:11px; }
.set-primary-button { color:#fff; border-color:#b91c1c; background:#d62828; }
.set-equipment-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px; }
.set-equipment-card { display:flex; min-width:0; gap:12px; padding:12px; border:1px solid var(--set-line); border-radius:12px; background:var(--set-bg); }
.set-equipment-card > img { width:82px; height:82px; flex:0 0 82px; object-fit:cover; border-radius:8px; background:var(--set-raised); }
.set-equipment-info, .set-call-info { display:flex; min-width:0; flex:1; flex-direction:column; gap:5px; }
.set-equipment-info small, .set-call-info small { color:var(--set-muted); }
.set-equipment-state { font-size:12px; font-weight:800; }
.set-equipment-actions { display:flex; gap:6px; margin-top:4px; }
.set-equipment-actions button, .set-attendance-actions button { min-width:46px; min-height:44px; border:1px solid var(--set-line); border-radius:8px; color:var(--set-text); background:var(--set-raised); cursor:pointer; }
.set-call-list { display:grid; gap:10px; }
.set-call-card { display:flex; align-items:center; gap:12px; padding:12px; border:1px solid var(--set-line); border-radius:12px; background:var(--set-bg); }
.set-call-card > img, .set-avatar { width:64px; height:64px; flex:0 0 64px; object-fit:cover; border-radius:50%; background:var(--set-raised); }
.set-avatar { display:grid; place-items:center; font-size:28px; }
.set-attendance-state { color:var(--set-status-warning); font-size:12px; font-weight:800; }
.set-attendance-actions { display:flex; flex-wrap:wrap; gap:5px; margin-top:4px; }
.set-attendance-actions button { padding:5px 8px; font-size:11px; }
.set-contact-actions { display:flex; flex-direction:column; gap:6px; }
.set-contact-actions a { display:grid; min-width:44px; min-height:42px; place-items:center; border-radius:8px; color:var(--set-text); background:var(--set-raised); text-decoration:none; font-weight:800; }
.set-script-reading { max-width:900px; margin:0 auto; }
.set-script-paper { max-height:52vh; overflow:auto; margin:14px 0; padding:clamp(18px, 4vw, 42px); border:1px solid var(--set-line); border-radius:10px; color:#111827; background:#fff; font:18px/1.75 Georgia, serif; white-space:normal; }
.set-script-paper h2 { font:800 16px/1.4 "Segoe UI", sans-serif; }
.set-note-form { display:grid; gap:8px; margin-top:18px; }
.set-note-form textarea { width:100%; resize:vertical; }
.set-note-form > div { display:flex; justify-content:flex-end; gap:8px; }
.set-dpr-summary { display:grid; grid-template-columns:repeat(2, 1fr); gap:12px; }
.set-dpr-summary > div, .set-dpr-times > div { display:flex; flex-direction:column; gap:5px; padding:14px; border:1px solid var(--set-line); border-radius:10px; background:var(--set-bg); }
.set-dpr-summary strong { font-size:28px; } .set-dpr-summary span, .set-dpr-times span { color:var(--set-muted); font-size:12px; }
.set-dpr-times { display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; margin-top:14px; }
.set-dpr-times strong { font-size:22px; }
.set-dpr-times button { min-height:42px; border:1px solid var(--set-line); border-radius:8px; color:var(--set-text); background:var(--set-raised); cursor:pointer; }
.set-dpr-close { display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }
.set-closed-note { color:var(--set-status-good); }
.set-mode-nav { display:grid; grid-template-columns:repeat(5, 1fr); gap:6px; padding:8px 10px calc(8px + env(safe-area-inset-bottom)); border-top:1px solid var(--set-line); background:var(--set-card); }
.set-mode-nav-button { display:flex; min-height:64px; align-items:center; justify-content:center; flex-direction:column; gap:2px; border:1px solid transparent; border-radius:10px; color:var(--set-muted); background:transparent; font:inherit; cursor:pointer; touch-action:manipulation; }
.set-mode-nav-button span { font-size:22px; } .set-mode-nav-button strong { font-size:12px; }
.set-mode-nav-button.active { border-color:var(--set-accent); color:var(--set-text); background:var(--set-raised); }
.set-mode-toast { width:min(90%, 600px); margin:0 auto 10px; padding:12px 16px; border:1px solid var(--set-line); border-radius:10px; color:var(--set-text); background:var(--set-card); box-shadow:0 4px 14px rgba(0,0,0,.16); font-size:13px; }
.set-mode-toast[data-kind="error"] { border-color:var(--set-status-error); }
.set-mode-toast[data-kind="warning"] { border-color:var(--set-status-warning); }
#set-mode-root button:focus-visible, #set-mode-root select:focus-visible, #set-mode-root a:focus-visible { outline:3px solid var(--set-focus); outline-offset:2px; }
@media (max-width:900px) {
  body[data-active-view="set-mode"] .topbar,
  body[data-active-view="set-mode"] .workflow-ribbon,
  body[data-active-view="set-mode"] #cs-sidebar-nav,
  body[data-active-view="set-mode"] #view-set-mode > .area-id-bar { display:none !important; }
  body[data-active-view="set-mode"] .app-layout,
  body[data-active-view="set-mode"] .main-workspace { min-height:0; height:100%; }
  body[data-active-view="set-mode"] #view-set-mode.active { min-height:0; height:100%; max-height:100%; }
  body[data-active-view="set-mode"] .set-mode-host,
  body[data-active-view="set-mode"] #set-mode-root { min-height:0; height:100%; max-height:100%; }
  .set-mode-header { flex-wrap:wrap; gap:8px; padding:8px 10px; }
  .set-mode-title { min-width:100px; flex:1; }
  .set-mode-title span { max-width:145px; }
  .set-mode-day { order:3; flex:1 1 100%; max-width:none; }
  .set-mode-live { min-width:86px; }
  .set-mode-header-actions { gap:5px; }
  .set-mode-connection { max-width:115px; overflow:hidden; text-overflow:ellipsis; }
  #set-mode-root select { min-width:0; max-width:100%; }
  .set-section-heading > select { min-width:0; max-width:100%; }
  .set-mode-main { padding:10px; }
  .set-form-grid { grid-template-columns:1fr 1fr; }
  .set-form-grid label:first-child { grid-column:1 / -1; }
  .set-dpr-times { grid-template-columns:repeat(2, 1fr); }
  .set-call-card { align-items:flex-start; }
  .set-call-card > img, .set-avatar { width:48px; height:48px; flex-basis:48px; }
  .set-contact-actions { flex-direction:row; }
}
@media (max-width:420px) {
  .set-mode-live { order:2; }
  .set-mode-header-actions { order:2; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); width:100%; margin-left:0; }
  .set-mode-connection { grid-column:1 / -1; max-width:none; font-size:10px; white-space:normal; }
  .set-mode-action { min-width:0; padding:7px 6px; font-size:11px; }
  .set-rating-grid { gap:6px; }
  .set-rating { min-height:64px; font-size:14px; }
  .set-equipment-grid { grid-template-columns:1fr; }
  .set-mode-fullscreen-toggle { flex:auto; }
}

body.cs-set-mode-fullscreen { overflow:hidden !important; }
body.cs-set-mode-fullscreen .topbar,
body.cs-set-mode-fullscreen .workflow-ribbon,
body.cs-set-mode-fullscreen #cs-sidebar-nav,
body.cs-set-mode-fullscreen #view-set-mode > .area-id-bar,
body.cs-set-mode-fullscreen #cs-fullscreen-exit-fab { display:none !important; }
body.cs-set-mode-fullscreen #view-set-mode.active {
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  width:100vw;
  height:100vh;
  height:100dvh;
  max-height:100dvh;
  overflow:hidden;
  background:var(--bg-app, #111215);
}
body.cs-set-mode-fullscreen #view-set-mode.active .set-mode-host,
body.cs-set-mode-fullscreen #set-mode-root { min-height:0; height:100%; max-height:100%; }
body.cs-set-mode-fullscreen .set-mode-header { padding-top:calc(8px + env(safe-area-inset-top)); }
body.cs-set-mode-fullscreen #set-mode-root { width:100%; }
body.cs-set-mode-fullscreen .set-mode-main { overscroll-behavior:contain; }

dialog.cs-guide-dialog:not([open]),
dialog:not([open]) {
  display: none !important;
}
dialog.cs-guide-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(1040px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  height: min(86dvh, 820px);
  max-height: calc(100dvh - 16px);
  min-height: 0;
  padding: 0;
  overflow: hidden;
  color: var(--text-primary, #e2e8f0);
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border-color, #475569);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  box-sizing: border-box;
  z-index: 100020;
}
dialog.cs-guide-dialog[open] {
  display: flex !important;
  flex-direction: column;
}
dialog.cs-guide-dialog::backdrop { background:rgba(2,6,23,.72); backdrop-filter:blur(4px); }

/* Garantía global de centrado, cierre y ajuste responsivo en Tablet y Móvil para TODAS las pantallas flotantes */
.modal-backdrop,
.cs-pro-modal-backdrop,
.ccos-modal-backdrop,
.cesco-modal-backdrop,
.cs-floating-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vw, 20px);
  overflow-y: auto;
  box-sizing: border-box;
}
.modal-backdrop > .modal-card,
.cs-pro-modal-backdrop > .cs-pro-modal,
.ccos-modal-backdrop > .ccos-modal-sheet,
.cesco-modal-backdrop > .cesco-modal-card,
.cs-floating-modal-backdrop > .cs-floating-modal-card {
  margin: auto;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  box-sizing: border-box;
}
@media (max-width: 980px) {
  dialog.cs-guide-dialog {
    width: min(740px, calc(100vw - 16px));
    height: min(88dvh, 760px);
  }
  .modal-card,
  .modal-lg,
  .modal-xl,
  .cs-pro-modal,
  .ccos-modal-sheet,
  .cesco-modal-card,
  .cs-floating-modal-card {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 12px !important;
  }
  .modal-header,
  .cs-pro-modal-header,
  .ccos-modal-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }
}
.cs-guide-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:20px 22px 12px; border-bottom:1px solid var(--border-color, #475569); }
.cs-guide-header h2, .cs-guide-tour h3 { margin:2px 0 0; font-size:20px; }
.cs-guide-eyebrow { margin:0; color:var(--accent-primary, #38bdf8); font-size:10px; font-weight:900; letter-spacing:.12em; }
.cs-guide-panel, .cs-guide-tour { padding:16px 22px 22px; }
.cs-guide-panel > p, .cs-guide-tour > p:not(.cs-guide-eyebrow) { color:var(--text-secondary, #94a3b8); line-height:1.55; }
.cs-guide-status-list { display:grid; gap:8px; margin:14px 0; }
.cs-guide-status-list > div { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1.1fr); gap:12px; padding:10px 12px; border:1px solid var(--border-color, #334155); border-radius:9px; background: #131c31; }
.cs-guide-status-list dt { font-weight:750; color: #f8fafc; }
.cs-guide-status-list dd { margin:0; text-align:right; color:var(--text-secondary, #cbd5e1); }
.cs-guide-status-list dd[data-state="ok"] { color:#34d399; }
.cs-guide-status-list dd[data-state="warning"], .cs-guide-status-list dd[data-state="offline"] { color:#fbbf24; }
.cs-guide-status-list dd[data-state="error"] { color:#f87171; }
.cs-guide-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; margin-top:16px; }
.cs-guide-actions button:disabled { opacity:.55; cursor:not-allowed; }
html[data-theme="light"] dialog.cs-guide-dialog { color:#0f2942 !important; background:#ffffff !important; border-color:#cbd5e1 !important; box-shadow:0 24px 80px rgba(15, 41, 66, 0.16) !important; }
html[data-theme="light"] .cs-guide-status-list > div { border-color:#e2e8f0 !important; background: #ffffff !important; }
html[data-theme="light"] .cs-guide-status-list dt { color: #0f2942 !important; }
html[data-theme="light"] .cs-guide-status-list dd { color:#475569 !important; }
html[data-theme="light"] .cs-guide-panel > p, html[data-theme="light"] .cs-guide-tour > p:not(.cs-guide-eyebrow) { color:#475569 !important; }
html[data-theme="light"] #cs-guide-tour-step-title { color:#0077b6 !important; }
html[data-theme="light"] #cs-guide-tour-step-text { color:#334155 !important; }

/* ============================================================================
   LOCALIZADOR INTERACTIVO & CENTRO DE AYUDA: UNIFICACIÓN CANÓNICA DÍA Y NOCHE
   ============================================================================ */
.cs-guide-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #1e293b;
  background: #0b1120;
  flex-shrink: 0;
  box-sizing: border-box;
}
html[data-theme="light"] .cs-guide-modal-header {
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}
.cs-guide-modal-eyebrow {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #38bdf8;
  text-transform: uppercase;
}
html[data-theme="light"] .cs-guide-modal-eyebrow {
  color: #0077b6 !important;
}
.cs-guide-modal-title {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  word-break: break-word;
}
html[data-theme="light"] .cs-guide-modal-title {
  color: #0f2942 !important;
}
.cs-guide-close-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #475569;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 18px;
  line-height: 1;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cs-guide-close-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #94a3b8;
}
html[data-theme="light"] .cs-guide-close-btn {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f2942 !important;
}
html[data-theme="light"] .cs-guide-close-btn:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
}

/* Barra de Pestañas Principales */
.cs-help-main-tab-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid #1e293b;
  background: #0b1120;
  overflow-x: auto;
  flex-shrink: 0;
  height: 46px;
  min-height: 46px;
  box-sizing: border-box;
}
html[data-theme="light"] .cs-help-main-tab-bar {
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}
.cs-help-main-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-height: 32px;
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  box-sizing: border-box;
  transition: all 0.15s ease;
}
.cs-help-main-tab-btn:hover {
  color: #f8fafc;
  border-color: #475569;
}
.cs-help-main-tab-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}
html[data-theme="light"] .cs-help-main-tab-btn {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] .cs-help-main-tab-btn:hover {
  background: #e2e8f0 !important;
  color: #0f2942 !important;
}
html[data-theme="light"] .cs-help-main-tab-btn.active {
  background: #0077b6 !important;
  color: #ffffff !important;
  border-color: #0077b6 !important;
}

/* Panel del Localizador */
.cs-guide-locator-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  padding: 14px 16px;
  box-sizing: border-box;
  background: transparent;
}

/* Buscador y Contador */
.cs-locator-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  box-sizing: border-box;
}
.cs-locator-search-wrap {
  position: relative;
  flex: 1 1 200px;
  min-width: 0;
}
.cs-locator-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
  pointer-events: none;
}
.cs-locator-search-input {
  width: 100%;
  padding: 9px 12px;
  padding-left: 34px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.88rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.cs-locator-search-input:focus {
  border-color: #38bdf8;
}
html[data-theme="light"] .cs-locator-search-input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f2942 !important;
}
html[data-theme="light"] .cs-locator-search-input:focus {
  border-color: #0077b6 !important;
}
.cs-locator-count-badge {
  font-size: 0.75rem;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 5px 10px;
  border-radius: 12px;
  font-weight: 700;
}
html[data-theme="light"] .cs-locator-count-badge {
  background: #e2e8f0 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}

/* Pills de Área */
.cs-locator-area-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px 0;
  margin-bottom: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  scrollbar-width: thin;
}
.cs-area-pill-btn {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 0.76rem;
  flex-shrink: 0;
  line-height: 1;
  box-sizing: border-box;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cs-area-pill-btn:hover {
  color: #f8fafc;
  border-color: #475569;
}
.cs-area-pill-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}
html[data-theme="light"] .cs-area-pill-btn {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] .cs-area-pill-btn:hover {
  background: #e2e8f0 !important;
  color: #0f2942 !important;
}
html[data-theme="light"] .cs-area-pill-btn.active {
  background: #0077b6 !important;
  color: #ffffff !important;
  border-color: #0077b6 !important;
}

/* Tarjetas de Servicio en el Localizador */
.cs-locator-results {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
  box-sizing: border-box;
}
.cs-service-card {
  background: #131c31;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}
.cs-service-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}
html[data-theme="light"] .cs-service-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15, 41, 66, 0.05) !important;
}
html[data-theme="light"] .cs-service-card:hover {
  border-color: #0095d9 !important;
  box-shadow: 0 6px 18px rgba(0, 149, 217, 0.12) !important;
  transform: translateY(-1px);
}

.cs-service-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.cs-service-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 280px;
}
.cs-service-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}
.cs-service-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cs-service-title {
  color: #f8fafc;
  font-size: 0.95rem;
}
html[data-theme="light"] .cs-service-title {
  color: #0f2942 !important;
}
.cs-service-summary {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #94a3b8;
}
html[data-theme="light"] .cs-service-summary {
  color: #475569 !important;
}
.cs-service-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cs-btn-toggle-desc {
  border: 1px solid #475569;
  color: #94a3b8;
  background: transparent;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cs-btn-toggle-desc:hover,
.cs-btn-toggle-desc.open {
  border-color: #38bdf8;
  color: #38bdf8;
}
html[data-theme="light"] .cs-btn-toggle-desc {
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}
html[data-theme="light"] .cs-btn-toggle-desc:hover,
html[data-theme="light"] .cs-btn-toggle-desc.open {
  border-color: #0077b6 !important;
  color: #0077b6 !important;
}

.cs-service-detail {
  background: #0b1120;
  border-top: 1px solid #1e293b;
  border-radius: 6px;
  padding: 12px;
  margin-top: 6px;
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.55;
}
html[data-theme="light"] .cs-service-detail {
  background: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
  color: #1e293b !important;
}

/* Badges y Submenú */
.cs-service-tag-submenu {
  font-size: 0.7rem;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 2px 7px;
  border-radius: 10px;
}
html[data-theme="light"] .cs-service-tag-submenu {
  background: #e2e8f0 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}
.cs-service-tag-badge {
  font-size: 0.68rem;
  background: #059669;
  color: #d1fae5;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
html[data-theme="light"] .cs-service-tag-badge {
  background: #d1fae5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}

/* IDENTIDADES DE MARCA POR ÁREA (RED MOUSE, CESCO, PROCREAR, FINANZAS) */

/* 1. Red Mouse Films (Guion, Producción, Rodaje, Dailies, Distribución, Master) */
.cs-tag-brand-redmouse {
  font-size: 0.7rem;
  background: rgba(225, 29, 72, 0.18);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.4);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
html[data-theme="light"] .cs-tag-brand-redmouse {
  background: #ffe4e6 !important;
  color: #be123c !important;
  border-color: #fecdd3 !important;
}
.cs-card-brand-redmouse:hover {
  border-color: #e11d48 !important;
}
.cs-btn-brand-redmouse {
  background: #e11d48 !important;
  border-color: #e11d48 !important;
  color: #ffffff !important;
}
.cs-btn-brand-redmouse:hover {
  background: #be123c !important;
  border-color: #be123c !important;
}

/* 2. Cesco Social Suite */
.cs-tag-brand-cesco {
  font-size: 0.7rem;
  background: rgba(139, 92, 246, 0.18);
  color: #ddd6fe;
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
html[data-theme="light"] .cs-tag-brand-cesco {
  background: #ede9fe !important;
  color: #6d28d9 !important;
  border-color: #ddd6fe !important;
}
.cs-card-brand-cesco:hover {
  border-color: #8b5cf6 !important;
}
.cs-btn-brand-cesco {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #ffffff !important;
}
.cs-btn-brand-cesco:hover {
  background: #6d28d9 !important;
  border-color: #6d28d9 !important;
}

/* 3. Procrear / SafeMouse (Registro Legal) */
.cs-tag-brand-procrear {
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.18);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
html[data-theme="light"] .cs-tag-brand-procrear {
  background: #d1fae5 !important;
  color: #047857 !important;
  border-color: #a7f3d0 !important;
}
.cs-card-brand-procrear:hover {
  border-color: #10b981 !important;
}
.cs-btn-brand-procrear {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}
.cs-btn-brand-procrear:hover {
  background: #047857 !important;
  border-color: #047857 !important;
}

/* 4. Finanzas / ICAA */
.cs-tag-brand-finanzas {
  font-size: 0.7rem;
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
html[data-theme="light"] .cs-tag-brand-finanzas {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
}
.cs-card-brand-finanzas:hover {
  border-color: #f59e0b !important;
}
.cs-btn-brand-finanzas {
  background: #d97706 !important;
  border-color: #d97706 !important;
  color: #ffffff !important;
}
.cs-btn-brand-finanzas:hover {
  background: #b45309 !important;
  border-color: #b45309 !important;
}
@media (max-width:560px) {
  dialog.cs-guide-dialog { width:calc(100vw - 16px); max-height:90dvh; border-radius:12px; }
  .cs-guide-header, .cs-guide-panel, .cs-guide-tour { padding-left:14px; padding-right:14px; }
  .cs-guide-status-list > div { grid-template-columns:1fr; gap:4px; }
  .cs-guide-status-list dd { text-align:left; }
  .cs-guide-actions { justify-content:stretch; }
  .cs-guide-actions button { flex:1 1 100%; min-height:42px; }
}

/* ============================================================================
   CCOS v4.0 + MULTI-IA + MESA REDONDA: COHERENCIA TEMA CLARO Y OSCURO (WCAG AA)
   ============================================================================ */
#cs-ccos-script-ribbon,
.cs-ccos-ribbon-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
  color: #f8fafc;
  border-bottom: 1px solid rgba(56, 189, 248, 0.28);
}

#cs-ccos-script-ribbon label {
  color: #cbd5e1 !important;
}

#cs-ccos-script-ribbon #ccos-bar-thermostat-genre {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(56, 189, 248, 0.42);
}

html[data-theme="light"] #cs-ccos-script-ribbon,
html[data-theme="light"] .cs-ccos-ribbon-bar {
  background: linear-gradient(90deg, #f8fafc 0%, #eff6ff 100%) !important;
  color: #0f172a !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] #cs-ccos-script-ribbon label {
  color: #1e293b !important;
  font-weight: 700;
}

html[data-theme="light"] #cs-ccos-script-ribbon #ccos-bar-thermostat-genre {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #0284c7 !important;
}

html[data-theme="light"] #cs-ccos-script-ribbon span[style*="color:#fbbf24"] {
  color: #78350f !important;
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
}

html[data-theme="light"] #cs-ccos-script-ribbon #btn-ccos-ribbon-audit span {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

/* Consolas Pro Oscuras (Studio CCOS v4.0 + Multi-IA): contraste protegido en tema claro y oscuro */
#cs-modal-ccos-v4-studio .modal-card,
html[data-theme="light"] #cs-modal-ccos-v4-studio .modal-card {
  background: #0b1120 !important;
  color: #f8fafc !important;
  border: 1.5px solid #38bdf8 !important;
}

#cs-modal-ccos-v4-studio .modal-header,
html[data-theme="light"] #cs-modal-ccos-v4-studio .modal-header {
  background: linear-gradient(135deg, #0f172a, #1e1b4b) !important;
  color: #f8fafc !important;
  border-bottom: 1px solid #1e293b !important;
}

#cs-modal-ccos-v4-studio .modal-footer,
html[data-theme="light"] #cs-modal-ccos-v4-studio .modal-footer {
  background: #090d16 !important;
  color: #cbd5e1 !important;
  border-top: 1px solid #1e293b !important;
}

#cs-modal-ccos-v4-studio .btn-icon,
html[data-theme="light"] #cs-modal-ccos-v4-studio .btn-icon,
#cs-client-ai-config-modal #cs-ai-modal-close,
html[data-theme="light"] #cs-client-ai-config-modal #cs-ai-modal-close {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(148, 163, 184, 0.45) !important;
  border-radius: 6px;
}

#cs-modal-ccos-v4-studio .btn-icon:hover,
html[data-theme="light"] #cs-modal-ccos-v4-studio .btn-icon:hover,
#cs-client-ai-config-modal #cs-ai-modal-close:hover,
html[data-theme="light"] #cs-client-ai-config-modal #cs-ai-modal-close:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
}

#cs-modal-ccos-v4-studio .btn-secondary,
html[data-theme="light"] #cs-modal-ccos-v4-studio .btn-secondary,
#cs-client-ai-config-modal .btn-secondary,
html[data-theme="light"] #cs-client-ai-config-modal .btn-secondary {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border: 1px solid #475569 !important;
}

#cs-modal-ccos-v4-studio .btn-secondary:hover,
html[data-theme="light"] #cs-modal-ccos-v4-studio .btn-secondary:hover,
#cs-client-ai-config-modal .btn-secondary:hover,
html[data-theme="light"] #cs-client-ai-config-modal .btn-secondary:hover {
  background: #334155 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

#cs-modal-ccos-v4-studio .form-input,
#cs-modal-ccos-v4-studio .form-select,
html[data-theme="light"] #cs-modal-ccos-v4-studio .form-input,
html[data-theme="light"] #cs-modal-ccos-v4-studio .form-select,
#cs-client-ai-config-modal .form-input,
#cs-client-ai-config-modal .form-select,
html[data-theme="light"] #cs-client-ai-config-modal .form-input,
html[data-theme="light"] #cs-client-ai-config-modal .form-select {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
}

html[data-theme="light"] #cs-modal-ccos-v4-studio .form-select option,
html[data-theme="light"] #cs-client-ai-config-modal .form-select option,
html[data-theme="light"] #cs-client-ai-config-modal #cs-select-provider-model option,
html[data-theme="light"] #cs-quick-ai-provider-select option {
  background: #0f172a;
  color: #f8fafc;
}

html[data-theme="light"] .cs-client-ai-banner .btn-secondary {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

html[data-theme="light"] #cs-modal-script-roundtable .rt-controls,
html[data-theme="light"] #cs-modal-script-roundtable .rt-footer {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] #cs-modal-script-roundtable .rt-chips {
  background: #f1f5f9 !important;
  border-bottom-color: #cbd5e1 !important;
}

/* ============================================================================
   UNIFICACIÓN CSS DÍA + MENÚ DOBLE APILADO EN 01-GUION (SIN SOLAPAMIENTO NI COLORINES)
   + REGISTRO LEGAL / DISTRIBUCIÓN / MASTER COHERENTES + RESPONSIVE MULTI-DISPOSITIVO
   ============================================================================ */
body[data-active-area="guion"] #cs-area-context-bar {
  height: auto !important;
  min-height: 0 !important;
  padding: 6px 12px !important;
  flex-direction: column !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  background: var(--bg-panel, #ffffff) !important;
  border-bottom: 1px solid var(--border-color, #cbd5e1) !important;
}
body[data-active-area="guion"] .cs-guion-top-submenu {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  width: 100% !important;
}
body[data-active-area="guion"] .cs-guion-top-submenu-body {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 5px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  overflow: visible !important;
}
.cs-guion-top-views-strip {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 5px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}
body[data-active-area="guion"] .cs-guion-top-sep {
  width: 100% !important;
  height: 1px !important;
  margin: 0 !important;
  background: var(--border-color, #cbd5e1) !important;
}
.cs-guion-top-actions-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 5px !important;
  width: 100% !important;
  overflow: visible !important;
}
.cs-guion-top-script-tools {
  flex-wrap: wrap !important;
  gap: 5px !important;
  white-space: normal !important;
}
/* Unificar estética sobria Día en todos los botones del menú Guion (sin "colorines") */
html[data-theme="light"] .cs-guion-top-submenu .cs-guion-top-item,
html[data-theme="light"] .cs-guion-top-submenu .cs-guion-top-actions-row > .btn,
html[data-theme="light"] .cs-guion-top-submenu .cs-guion-top-actions-row > .dropdown > .btn,
html[data-theme="light"] .cs-guion-top-submenu .cs-guion-top-script-tools > .btn {
  background: var(--bg-card, #ffffff) !important;
  color: var(--text-primary, #0f172a) !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  padding: 4px 8px !important;
  border-radius: 7px !important;
}
html[data-theme="light"] .cs-guion-top-submenu .cs-guion-top-item:hover,
html[data-theme="light"] .cs-guion-top-submenu .cs-guion-top-actions-row > .btn:hover,
html[data-theme="light"] .cs-guion-top-submenu .cs-guion-top-actions-row > .dropdown > .btn:hover,
html[data-theme="light"] .cs-guion-top-submenu .cs-guion-top-script-tools > .btn:hover {
  background: var(--bg-elevated, #f0f9ff) !important;
  border-color: var(--accent-primary, #0284c7) !important;
  color: var(--accent-primary, #0369a1) !important;
}
html[data-theme="light"] .cs-guion-top-submenu .cs-guion-top-item.active,
html[data-theme="light"] .cs-guion-top-submenu #btn-save-disk {
  background: var(--accent-primary, #0369a1) !important;
  border-color: var(--accent-primary, #0369a1) !important;
  color: #ffffff !important;
}
html[data-theme="light"] .cs-guion-top-submenu .dropdown-menu {
  background: var(--bg-card, #ffffff) !important;
  color: var(--text-primary, #0f172a) !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
}
html[data-theme="light"] .cs-guion-top-submenu .dropdown-menu button {
  color: var(--text-primary, #0f172a) !important;
}
html[data-theme="light"] .cs-guion-top-submenu .dropdown-menu button:hover {
  background: var(--bg-elevated, #eff6ff) !important;
  color: var(--accent-primary, #0369a1) !important;
}
html[data-theme="light"] #btn-ctx-theater-roundtable,
html[data-theme="light"] #btn-theater-pro-suite-8 {
  background: var(--bg-card, #ffffff) !important;
  color: var(--text-primary, #0f172a) !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
  text-shadow: none !important;
}

/* Unificación coherente Modo Día en Registro Legal, Distribución, Master y Finanzas */
html[data-theme="light"] #view-legal-registry,
html[data-theme="light"] #legal-registry-platform-container,
html[data-theme="light"] #view-distribution,
html[data-theme="light"] #distribution-container,
html[data-theme="light"] #view-master,
html[data-theme="light"] #master-package-container,
html[data-theme="light"] #view-crm-clients,
html[data-theme="light"] #view-budgets {
  background: var(--bg-app, #f1f5f9) !important;
  color: var(--text-primary, #0f172a) !important;
}

html[data-theme="light"] #legal-registry-platform-container [style*="0f172a"],
html[data-theme="light"] #legal-registry-platform-container [style*="15,23,42"],
html[data-theme="light"] #legal-registry-platform-container [style*="2,6,23"],
html[data-theme="light"] #legal-registry-platform-container [style*="rgba(6,78,59"],
html[data-theme="light"] #distribution-container [style*="0f172a"],
html[data-theme="light"] #distribution-container [style*="15,23,42"],
html[data-theme="light"] #distribution-container [style*="9,13,22"],
html[data-theme="light"] #master-package-container [style*="0f172a"],
html[data-theme="light"] #master-package-container [style*="15,23,42"] {
  background: var(--bg-card, #ffffff) !important;
  color: var(--text-primary, #0f172a) !important;
  border-color: var(--border-color, #cbd5e1) !important;
}

html[data-theme="light"] #legal-registry-platform-container [style*="127,29,29"] {
  background: #fff1f2 !important;
  color: #9f1239 !important;
  border-color: #e11d48 !important;
}

html[data-theme="light"] #legal-registry-platform-container :is(h1,h2,h3,h4,strong,span,div,p,label,code,summary,td,th)[style*="#f8fafc"],
html[data-theme="light"] #legal-registry-platform-container :is(h1,h2,h3,h4,strong,span,div,p,label,code,summary,td,th)[style*="#cbd5e1"],
html[data-theme="light"] #legal-registry-platform-container :is(h1,h2,h3,h4,strong,span,div,p,label,code,summary,td,th)[style*="#e0f2fe"],
html[data-theme="light"] #legal-registry-platform-container :is(h1,h2,h3,h4,strong,span,div,p,label,code,summary,td,th)[style*="#ffffff"],
html[data-theme="light"] #distribution-container :is(h1,h2,h3,h4,strong,span,div,p,label,code,td,th)[style*="#f8fafc"],
html[data-theme="light"] #distribution-container :is(h1,h2,h3,h4,strong,span,div,p,label,code,td,th)[style*="#cbd5e1"],
html[data-theme="light"] #master-package-container :is(h1,h2,h3,h4,strong,span,div,p,label,code,td,th)[style*="#f8fafc"],
html[data-theme="light"] #master-package-container :is(h1,h2,h3,h4,strong,span,div,p,label,code,td,th)[style*="#cbd5e1"] {
  color: var(--text-primary, #0f172a) !important;
}

html[data-theme="light"] #legal-registry-platform-container [style*="#5eead4"],
html[data-theme="light"] #legal-registry-platform-container [style*="#7dd3fc"],
html[data-theme="light"] #legal-registry-platform-container [style*="#93c5fd"] {
  color: #0369a1 !important;
}
html[data-theme="light"] #legal-registry-platform-container [style*="#6ee7b7"],
html[data-theme="light"] #legal-registry-platform-container [style*="#34d399"] {
  color: #047857 !important;
}
html[data-theme="light"] #legal-registry-platform-container [style*="#fde68a"],
html[data-theme="light"] #distribution-container [style*="#fde68a"],
html[data-theme="light"] #master-package-container [style*="#fde68a"] {
  color: #92400e !important;
}
html[data-theme="light"] #legal-registry-platform-container [style*="#fecdd3"],
html[data-theme="light"] #legal-registry-platform-container [style*="#fda4af"],
html[data-theme="light"] #legal-registry-platform-container [style*="#fb7185"] {
  color: #9f1239 !important;
}

html[data-theme="light"] #view-legal-registry .area-id-bar,
html[data-theme="light"] #view-master .area-id-bar,
html[data-theme="light"] #view-distribution .area-id-bar,
html[data-theme="light"] #view-budgets .area-id-bar {
  background: var(--bg-panel, #ffffff) !important;
  color: var(--text-primary, #0f172a) !important;
  border-bottom: 1px solid var(--border-color, #cbd5e1) !important;
}

/* Rejillas responsivas (Contabilidad, Tema Día, Empresa SaaS) para ordenador, portátil, tablet y móvil */
.cs-fin-responsive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.cs-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#cs-modal-theme-studio .modal-card,
#cs-modal-company-saas .modal-card {
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  border: 1.5px solid var(--border-color, #cbd5e1);
}
.cs-ts-modal-body {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 14px;
  max-height: 76vh;
  overflow-y: auto;
}
.cs-ts-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}
.cs-ts-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}
.cs-ts-field-lbl {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #475569);
}
.cs-ts-field-lbl input[type="color"] {
  width: 100%;
  height: 30px;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
}
.cs-ts-accordion {
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 9px;
  background: var(--bg-card, #ffffff);
  overflow: hidden;
}
.cs-ts-accordion summary {
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  background: var(--bg-elevated, #f8fafc);
  color: var(--text-primary, #0f172a);
  list-style: none;
  border-bottom: 1px solid transparent;
}
.cs-ts-accordion[open] summary {
  border-bottom-color: var(--border-color, #cbd5e1);
}
.cs-ts-acc-body {
  padding: 10px 12px;
}
.cs-sb-accordion {
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 9px;
  background: var(--bg-card, #ffffff);
  margin-bottom: 8px;
  overflow: hidden;
}
.cs-sb-accordion summary {
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  background: var(--bg-elevated, #f8fafc);
  color: var(--text-primary, #0f172a);
  list-style: none;
  border-bottom: 1px solid transparent;
}
.cs-sb-accordion[open] summary {
  border-bottom-color: var(--border-color, #cbd5e1);
}
.cs-sb-acc-body {
  padding: 8px 10px;
}
.cs-ts-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.cs-ts-preset-btn.active {
  border-color: var(--accent-primary, #0284c7);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.22);
}
.cs-ts-swatch {
  width: 16px;
  height: 16px;
  border-radius: 99px;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
}
.cs-ts-color-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #475569);
}
.cs-ts-color-inputs {
  display: flex;
  gap: 4px;
  align-items: center;
}
.cs-ts-color-inputs input[type="color"] {
  width: 32px;
  height: 28px;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
}
.cs-ts-color-inputs input[type="text"] {
  width: 78px;
  font-family: monospace;
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 6px;
  background: var(--bg-input, #ffffff);
  color: var(--text-primary, #0f172a);
}
@media (max-width: 1024px) {
  .cs-ts-modal-body {
    grid-template-columns: 1fr;
  }
  .cs-guion-top-views-strip,
  .cs-guion-top-actions-row {
    gap: 4px !important;
  }
}
@media (max-width: 640px) {
  .cs-fin-responsive-grid {
    grid-template-columns: 1fr;
  }
  .cs-finance-top-banner button {
    width: 100%;
    text-align: left;
  }
}

/* ============================================================================
   NAVEGABILIDAD TÁCTIL EN MÓVIL Y TABLET (<= 980px) Y BARRA RÁPIDA INFERIOR
   ============================================================================ */
.cs-mobile-tablet-quickbar {
  display: none;
}

.cs-crm-name-trigger:hover {
  color: var(--accent-primary, #0284c7) !important;
}

html[data-theme="light"] #cs-ai-copilot-modal .cs-floating-modal-card {
  background: var(--bg-panel, #ffffff) !important;
  color: var(--text-primary, #0f172a) !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
}
html[data-theme="light"] #cs-ai-copilot-modal .cs-floating-modal-card > div:first-child,
html[data-theme="light"] #cs-ai-copilot-modal #cs-copilot-tabs,
html[data-theme="light"] #cs-ai-copilot-modal .cs-floating-modal-card > div:last-child {
  background: var(--bg-elevated, #f8fafc) !important;
  border-color: var(--border-color, #cbd5e1) !important;
  color: var(--text-primary, #0f172a) !important;
}
html[data-theme="light"] #cs-ai-copilot-modal #cs-copilot-guide-content {
  background: var(--bg-card, #ffffff) !important;
  border-color: var(--border-color, #cbd5e1) !important;
  color: var(--text-primary, #0f172a) !important;
}
html[data-theme="light"] #cs-ai-copilot-modal #cs-copilot-guide-content h3,
html[data-theme="light"] #cs-ai-copilot-modal #cs-copilot-guide-content h4 {
  color: #0369a1 !important;
}
html[data-theme="light"] #cs-ai-copilot-modal #cs-copilot-guide-content p,
html[data-theme="light"] #cs-ai-copilot-modal #cs-copilot-guide-content li {
  color: #1e293b !important;
}
html[data-theme="light"] #cs-ai-copilot-modal .cs-cpt-tab-btn:not(.active),
html[data-theme="light"] #cs-ai-copilot-modal .cs-cpt-chip {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}
html[data-theme="light"] #cs-ai-copilot-modal #cs-copilot-input {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
html[data-theme="light"] #cs-ai-copilot-modal #cs-copilot-close-btn {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

@media (max-width: 980px) {
  html, body {
    overflow-x: hidden;
  }
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }
  body[data-active-view="set-mode"],
  body.cs-workspace-fullscreen,
  body.cs-storyboard-fullscreen,
  body.cs-set-mode-fullscreen {
    padding-bottom: 0;
  }
  .app-layout {
    flex-direction: column !important;
  }
  .sidebar-nav {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color, #cbd5e1);
    max-height: 270px;
    transition: max-height 0.18s ease;
  }
  .sidebar-nav.is-collapsed {
    width: 100% !important;
    max-height: 44px !important;
    height: 44px !important;
    overflow: hidden !important;
  }
  .sidebar-nav.is-collapsed .sidebar-collapse-btn {
    justify-content: space-between !important;
    padding: 8px 12px !important;
  }
  .sidebar-nav.is-collapsed .sidebar-collapse-label,
  .sidebar-nav.is-collapsed .sidebar-collapse-arrow {
    display: inline-flex !important;
  }
  .sidebar-nav.is-collapsed .nav-list,
  .sidebar-nav.is-collapsed .scene-navigator,
  .sidebar-nav.is-collapsed .sidebar-bottom-dock {
    display: none !important;
  }
  .nav-item,
  .cs-top-area-btn,
  .cs-crm-name-trigger,
  .acc-tab-btn {
    min-height: 36px;
    touch-action: manipulation;
  }
  .cs-mobile-tablet-quickbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9850;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--bg-panel, #ffffff);
    border-top: 1.5px solid var(--border-color, #cbd5e1);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    overflow-x: auto;
  }
  body:not(.cs-authenticated) .cs-mobile-tablet-quickbar,
  body[data-active-view="set-mode"] .cs-mobile-tablet-quickbar,
  body.cs-workspace-fullscreen .cs-mobile-tablet-quickbar,
  body.cs-storyboard-fullscreen .cs-mobile-tablet-quickbar,
  body.cs-set-mode-fullscreen .cs-mobile-tablet-quickbar {
    display: none !important;
  }
  .cs-mb-qb-btn {
    flex: 1 1 0;
    min-width: 46px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary, #0f172a);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 4px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
  }
  .cs-mb-qb-btn small {
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }
  .cs-mb-qb-btn.active {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
  }
}
@media print {
  .cs-mobile-tablet-quickbar {
    display: none !important;
  }
}
