/* ========================================================
   SD AGENCY COCKPIT · PC CREATIVE STUDIO STYLESHEET
   Modo Oscuro Prémium (#090D16) con Acentos Neón Cian & Lima
   ======================================================== */

/* 1. CARGA DE TIPOGRAFÍAS LOCALES (.TTF) */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lora';
  src: url('/fonts/Lora.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('/fonts/Nunito.ttf') format('truetype');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'NunitoSans';
  src: url('/fonts/NunitoSans.ttf') format('truetype');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* 2. VARIABLES DE DISEÑO & PALETA */
:root {
  --bg-dark: #090D16;
  --bg-card: rgba(16, 23, 38, 0.85);
  --bg-card-hover: rgba(26, 36, 56, 0.95);
  --bg-input: #0F172A;
  --border-color: #1E293B;
  --border-focus: #00E5FF;
  
  --cyan-accent: #00E5FF;
  --cyan-glow: rgba(0, 229, 255, 0.25);
  --lime-accent: #C4F276;
  --lime-glow: rgba(196, 242, 118, 0.25);
  --coral-accent: #FF5376;
  --purple-accent: #9D4EDD;
  --gold-accent: #FFB703;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 3. RESET Y BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.dark-theme {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 10% 10%, rgba(0, 229, 255, 0.05) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(196, 242, 118, 0.04) 0px, transparent 50%);
  min-height: 100vh;
}

/* 4. HEADER PRINCIPAL */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(9, 13, 22, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-icon {
  font-size: 28px;
  background: linear-gradient(135deg, var(--cyan-accent), var(--lime-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px var(--cyan-glow));
}

.badge-text h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--cyan-accent);
  color: #000;
  border-radius: var(--radius-sm);
  letter-spacing: 1px;
}

.badge-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.brand-selector-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.pill-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.brand-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.brand-select option {
  background: #0F172A;
  color: var(--text-primary);
}

.brand-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan-accent);
  box-shadow: 0 0 8px currentColor;
  transition: var(--transition);
}

.system-status-indicators {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online .dot {
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.status-indicator.active .dot {
  background: var(--cyan-accent);
  box-shadow: 0 0 8px var(--cyan-accent);
}

.status-indicator.vps .dot {
  background: var(--purple-accent);
  box-shadow: 0 0 8px var(--purple-accent);
}

/* 5. NAVEGACIÓN PRINCIPAL */
.app-navigation {
  display: flex;
  gap: 8px;
  padding: 10px 24px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-btn.active {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

/* 6. PANELES & MÓDULOS */
.app-main-content {
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

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

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

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

.module-title-group h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.module-title-group p {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 900px;
}

/* 7. TARJETAS & GLASSMORPHISM */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyan-accent);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.card-badge.badge-idle {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border-color: rgba(148, 163, 184, 0.3);
}

.card-badge.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border-color: #059669;
}

.card-badge.badge-warning {
  background: rgba(255, 183, 3, 0.2);
  color: var(--gold-accent);
  border-color: var(--gold-accent);
}

.card-badge.badge-accent {
  background: rgba(196, 242, 118, 0.2);
  color: var(--lime-accent);
  border-color: var(--lime-accent);
}

.card-body {
  padding: 20px;
}

/* 8. FORMULARIOS & CONTROLES */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.col-4 { flex: 1; }
.col-6 { flex: 1; }

.form-input, .form-textarea, .form-input-sm {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
}

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

.form-input:focus, .form-textarea:focus, .form-input-sm:focus {
  outline: none;
  border-color: var(--cyan-accent);
  box-shadow: 0 0 10px var(--cyan-glow);
}

.form-textarea {
  resize: vertical;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan-accent);
  margin: 16px 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* BOTONES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #00B4D8, var(--cyan-accent));
  color: #090D16;
  box-shadow: 0 4px 14px var(--cyan-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #A8E836, var(--lime-accent));
  color: #090D16;
  box-shadow: 0 4px 14px var(--lime-glow);
}

.btn-secondary {
  background: #1E293B;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #334155;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
}

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

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

.btn-block {
  width: 100%;
}

.btn-pulse {
  position: relative;
  overflow: hidden;
}

.btn-pulse::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  20% { left: 100%; }
  100% { left: 100%; }
}

/* 9. ZONA DROP DE FOTOS */
.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.4);
  transition: var(--transition);
  position: relative;
}

.drop-zone:hover {
  border-color: var(--cyan-accent);
  background: rgba(0, 229, 255, 0.05);
}

.file-hidden {
  display: none;
}

.drop-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 6px;
}

.drop-zone p {
  font-size: 12px;
  color: var(--text-secondary);
}

.drop-zone small {
  font-size: 11px;
  color: var(--text-muted);
}

.drop-zone-preview {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 160px;
}

.drop-zone-preview img {
  max-height: 140px;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.btn-remove-preview {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--coral-accent);
  color: #fff;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
}

/* 10. MÓDULO 1: SALA DE DIRECCIÓN */
.direccion-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
}

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

.pipeline-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.6;
  transition: var(--transition);
}

.step-item.active {
  opacity: 1;
}

.step-num {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  background: #1E293B;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.step-title {
  font-size: 11px;
  color: var(--text-secondary);
}

.step-item.active .step-num {
  background: var(--cyan-accent);
  color: #090D16;
}

.step-checkpoint .step-num {
  border: 1px solid var(--lime-accent);
}

.step-checkpoint.active .step-num {
  background: var(--lime-accent);
  color: #090D16;
}

.step-arrow {
  color: var(--text-muted);
  font-size: 12px;
}

.pipeline-output {
  min-height: 400px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 440px;
}

/* RESULTADOS DEL PIPELINE */
.pipeline-results-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-section-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.result-section-box h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan-accent);
}

.hooks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hooks-list li {
  font-size: 13px;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.5);
  border-left: 3px solid var(--cyan-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* SELLOS DE ADUANA */
.aduana-badge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.aduana-badge-info h4 {
  font-size: 15px;
  color: #34D399;
  margin-bottom: 4px;
}

.aduana-badge-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.aduana-score-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  border: 3px solid #10B981;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #34D399;
}

.score-num {
  font-size: 18px;
  line-height: 1;
}

.score-max {
  font-size: 10px;
  color: var(--text-muted);
}

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

.aduana-criteria-table th, .aduana-criteria-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.aduana-criteria-table th {
  color: var(--text-muted);
  font-weight: 600;
}

/* TABLA STORYBOARD */
.storyboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}

.storyboard-table th {
  background: #1E293B;
  padding: 8px 10px;
  text-align: left;
  color: var(--text-secondary);
}

.storyboard-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.storyboard-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.time-tag {
  display: inline-block;
  padding: 2px 6px;
  background: var(--purple-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 11px;
}

/* 11. MÓDULO 2: GESTOR DE MARCAS */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.brand-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: var(--transition);
}

.brand-card:hover {
  border-color: rgba(0, 229, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

.brand-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.brand-info h3 {
  font-size: 16px;
  font-weight: 700;
}

.brand-niche {
  font-size: 12px;
  color: var(--cyan-accent);
}

.brand-colors-row {
  display: flex;
  gap: 8px;
}

.swatch-item {
  flex: 1;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  cursor: pointer;
  transition: var(--transition);
}

.swatch-item:hover {
  transform: scale(1.05);
}

.brand-fonts-box {
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
}

.font-preview-line {
  font-size: 14px;
  margin-top: 4px;
  color: var(--text-primary);
}

.brand-prods-list {
  font-size: 12px;
  color: var(--text-secondary);
}

.brand-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* 12. MÓDULO 3: EDITOR DE CAPAS (CANVA STUDIO) */
.editor-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(16, 23, 38, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

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

.editor-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
}

.editor-workspace {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  gap: 16px;
  min-height: calc(100vh - 220px);
}

@media (max-width: 1200px) {
  .editor-workspace {
    grid-template-columns: 240px 1fr;
  }
  .editor-props-panel {
    grid-column: span 2;
  }
}

.editor-layers-panel, .editor-props-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.panel-header h4 {
  font-size: 13px;
  font-weight: 700;
}

.badge-mini {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  background: #1E293B;
  border-radius: var(--radius-sm);
  color: var(--cyan-accent);
}

.layers-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.layer-item:hover {
  background: rgba(30, 41, 59, 0.8);
}

.layer-item.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--cyan-accent);
  color: var(--cyan-accent);
}

.layer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layer-actions {
  display: flex;
  gap: 4px;
}

.btn-icon-layer {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
}

.btn-icon-layer:hover {
  color: var(--text-primary);
}

.layers-footer {
  padding: 10px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 6px;
}

/* LIENZO DE DISEÑO */
.editor-canvas-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #06090F;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow: auto;
  position: relative;
}

.canvas-viewport {
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
}

#designerCanvas {
  max-width: 100%;
  max-height: 75vh;
  display: block;
  cursor: crosshair;
  background: #0B1D13;
}

.canvas-overlay-safezones {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.canvas-overlay-safezones.hidden {
  display: none;
}

.safe-zone-top, .safe-zone-bottom {
  background: rgba(239, 68, 68, 0.15);
  border: 1px dashed rgba(239, 68, 68, 0.5);
  color: #F87171;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

.safe-zone-top { height: 12%; }
.safe-zone-bottom { height: 18%; }

/* INSPECTOR DE PROPIEDADES */
.props-body {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  max-height: 380px;
  overflow-y: auto;
}

.empty-state-small {
  padding: 20px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.quick-content-box {
  padding: 14px;
  flex: 1;
  overflow-y: auto;
}

.quick-content-box h5 {
  font-size: 12px;
  font-weight: 700;
  color: var(--lime-accent);
  margin-bottom: 10px;
}

/* 13. MÓDULO 4: DEPARTAMENTOS Y ADUANAS */
.departments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.department-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: var(--transition);
}

.department-card:hover {
  border-color: var(--cyan-accent);
}

.dept-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.dept-icon {
  font-size: 20px;
}

.dept-header h4 {
  font-size: 14px;
  font-weight: 700;
}

.department-card p {
  font-size: 12px;
  color: var(--text-secondary);
}

.aduanas-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .aduanas-container {
    grid-template-columns: 1fr;
  }
}

/* 14. MÓDULO 5: HUB OPEN-SOURCE */
.repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.repo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition);
}

.repo-card:hover {
  border-color: rgba(0, 229, 255, 0.4);
}

.repo-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.repo-title-box h3 {
  font-size: 15px;
  font-weight: 700;
}

.repo-category-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan-accent);
}

.repo-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.repo-port-badge {
  font-size: 11px;
  padding: 3px 8px;
  background: #1E293B;
  border-radius: var(--radius-sm);
  color: var(--lime-accent);
  display: inline-block;
  align-self: flex-start;
}

.repo-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

/* MODALES */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-dialog {
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.modal-dialog-full {
  max-width: 1400px;
  width: 95%;
  height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-body-iframe {
  flex: 1;
}

.modal-body-iframe iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #090D16;
}

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

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.btn-close-modal:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.hex-palette-picker {
  display: flex;
  gap: 10px;
}

.color-picker-box {
  flex: 1;
  text-align: center;
}

.color-picker-box label {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.color-picker-box input[type="color"] {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.color-hex-label {
  font-size: 11px;
  font-family: monospace;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

/* NOTIFICACIÓN TOAST */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #101726;
  border: 1px solid var(--cyan-accent);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease-out;
}

.toast-notification.hidden {
  display: none;
}

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


/* ========================================================
   V2.0: CHAT CONVERSACIONAL CON HERMES + TARJETAS RÁPIDAS
   ======================================================== */

.quick-repos-section {
  background: rgba(16, 23, 38, 0.75);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 14px;
}

.quick-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-primary);
}

.quick-repos-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 1100px) {
  .quick-repos-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.quick-repo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(145deg, rgba(24, 34, 56, 0.9), rgba(15, 22, 38, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-repo-card:hover {
  border-color: var(--cyan-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 229, 255, 0.15);
}

.qr-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.qr-info h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.qr-info p {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-go {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cyan-accent);
  background: rgba(0, 229, 255, 0.12);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* BARRA DE MARCAS EN PASTILLAS */
.quick-brands-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(16, 23, 38, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 16px;
}

.qb-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.qb-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.brand-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.brand-pill-btn:hover {
  border-color: var(--cyan-accent);
  background: rgba(30, 41, 59, 1);
}

.brand-pill-btn.active {
  background: rgba(0, 229, 255, 0.16);
  border-color: var(--cyan-accent);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.25);
}

.brand-pill-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* GRID CONVERSACIONAL HERMES */
.hermes-workspace-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: stretch;
}

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

.hermes-chat-card {
  display: flex;
  flex-direction: column;
  height: 670px;
}

.hermes-delivery-card {
  display: flex;
  flex-direction: column;
  height: 670px;
}

.hermes-delivery-card .card-body {
  flex: 1;
  overflow-y: auto;
}

.hermes-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hermes-agent-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hermes-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00E5FF, #C4F276);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.3);
}

.hermes-agent-profile h3 {
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
}

.hermes-agent-profile p {
  font-size: 12px;
  color: var(--text-secondary);
}

.hermes-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* MENSAJES DEL CHAT */
.hermes-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(9, 13, 22, 0.55);
}

.chat-msg {
  display: flex;
  gap: 12px;
  max-width: 92%;
  animation: fadeInMsg 0.25s ease;
}

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

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.chat-msg.user .chat-msg-avatar {
  background: rgba(196, 242, 118, 0.18);
  border-color: rgba(196, 242, 118, 0.4);
}

.chat-msg-bubble {
  background: rgba(24, 34, 54, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #F1F5F9;
}

.chat-msg.user .chat-msg-bubble {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(37, 99, 235, 0.28));
  border-color: rgba(0, 229, 255, 0.4);
}

.chat-msg-img {
  max-width: 180px;
  max-height: 180px;
  border-radius: 10px;
  display: block;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.chat-action-card {
  margin-top: 12px;
  padding: 12px;
  background: rgba(9, 13, 22, 0.75);
  border: 1px solid rgba(196, 242, 118, 0.35);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-action-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* CHIPS DE SUGERENCIAS */
.hermes-quick-prompts {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.prompt-chip {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.25);
  color: #E2E8F0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prompt-chip:hover {
  background: rgba(0, 229, 255, 0.18);
  border-color: var(--cyan-accent);
  color: #FFFFFF;
}

/* ADJUNTO DE FOTO EN CHAT */
.chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(0, 229, 255, 0.1);
  border-top: 1px solid rgba(0, 229, 255, 0.3);
}

.chat-attachment-preview img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 8px;
  background: #090D16;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.att-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 12px;
}

.att-info span {
  color: var(--text-secondary);
  font-size: 11px;
}

/* COMPOSER INFERIOR */
.hermes-chat-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(16, 23, 38, 0.95);
  border-top: 1px solid var(--border-color);
}

.btn-attach-photo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-attach-photo:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--cyan-accent);
}

.chat-input-box {
  flex: 1;
  background: rgba(9, 13, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 14px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13.5px;
  resize: none;
  outline: none;
}

.chat-input-box:focus {
  border-color: var(--cyan-accent);
}

.btn-send-chat {
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
}
