/* ==========================================================================
   MBA HOLDING — DASHBOARD DE CONTROL DE PENDIENTES & MATRIZ MAESTRA
   Diseño de Alta Fidelidad basado en Mockup Oficial & Sistema MediaWorks
   ========================================================================== */

:root {
  --primary-navy: #0f172a;
  --navy-light: #1e293b;
  --slate-dark: #334155;
  --slate-medium: #64748b;
  --slate-light: #94a3b8;
  --border-color: #cbd5e1;
  --card-border: #0f172a;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  
  /* Estados Cromáticos */
  --color-critical: #ef4444;
  --color-high: #f97316;
  --color-medium-high: #f59e0b;
  --color-medium: #3b82f6;
  --color-low: #64748b;
  
  --emerald-green: #22c55e;
  --emerald-dark: #16a34a;
  --emerald-light: #dcfce7;
  --emerald-text: #15803d;
  
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-board: 20px;
  --radius-card: 12px;
  --shadow-board: 0 12px 36px -8px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 6px 16px rgba(15, 23, 42, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--primary-navy);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: 30px 20px 60px 20px;
}

.dashboard-wrapper {
  max-width: 1360px;
  margin: 0 auto;
}

/* ==========================================================================
   HEADER PRINCIPAL (Fidelidad Mockup)
   ========================================================================== */

.header-section {
  text-align: center;
  margin-bottom: 24px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--slate-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--emerald-green);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.btn-excel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #107c41; /* Microsoft Excel Green */
  color: #ffffff;
  padding: 9px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 124, 65, 0.25);
  transition: all 0.2s ease;
}

.btn-excel:hover {
  background: #0d6535;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 124, 65, 0.35);
}

.main-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 14px;
  color: var(--slate-medium);
  font-weight: 500;
}

.priority-banner {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.priority-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-dark);
}

.summary-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-dark);
}

.kpi-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}

.kpi-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.kpi-review {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #0e7490;
}

.kpi-pending {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

/* ==========================================================================
   PESTAÑAS Y BARRA DE CONTROL (Fiel al Mockup)
   ========================================================================== */

.tabs-control-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 20px;
  padding: 0 4px;
}

.tabs-group {
  display: flex;
  gap: 4px;
  position: relative;
  bottom: -1.5px; /* Engancha exactamente con el borde del tablero */
  z-index: 2;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1.5px solid var(--card-border);
  border-bottom: 1.5px solid var(--card-border);
  padding: 10px 22px;
  border-radius: 12px 12px 0 0;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-dark);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: #e2e8f0;
}

.tab-btn.active {
  background: #ffffff;
  border-bottom: 1.5px solid #ffffff; /* Abre hacia el contenedor inferior */
  color: var(--primary-navy);
  box-shadow: 0 -2px 6px rgba(0,0,0,0.03);
}

.tab-count {
  font-family: var(--font-mono);
  background: #e2e8f0;
  color: var(--primary-navy);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
}

.tab-btn.active .tab-count {
  background: var(--primary-navy);
  color: #ffffff;
}

.right-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.search-box input {
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 12px;
  color: var(--primary-navy);
  width: 220px;
}

.search-box svg {
  color: var(--slate-medium);
}

.current-date-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-dark);
}

/* ==========================================================================
   TABLERO ENMARCADO (Mockup Board)
   ========================================================================== */

.dashboard-board {
  background: var(--bg-card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-board);
  padding: 20px;
  box-shadow: var(--shadow-board);
  position: relative;
  z-index: 1;
}

/* Encabezado de Columnas del Mockup */
.board-header-row {
  display: grid;
  grid-template-columns: 45px 105px minmax(230px, 1.5fr) 100px 140px 185px minmax(170px, 1.3fr) 70px;
  gap: 12px;
  padding: 10px 16px 14px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-dark);
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.board-header-row .col {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.board-header-row .col-approve {
  justify-content: center;
}

.board-header-row .col-num {
  justify-content: center;
}

/* ==========================================================================
   TARJETAS DE FILAS (Cada entregable es una tarjeta redondeada)
   ========================================================================== */

.board-rows-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deliverable-card {
  display: grid;
  grid-template-columns: 45px 105px minmax(230px, 1.5fr) 100px 140px 185px minmax(170px, 1.3fr) 70px;
  gap: 12px;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.deliverable-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #0284c7;
}

.deliverable-card.is-approved {
  background: #fbfdfc;
}

/* Columna 1: N° */
.card-num {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-navy);
  text-align: center;
}

/* Columna 2: Prioridad */
.card-priority {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.prio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.prio-critica .prio-dot { background-color: var(--color-critical); }
.prio-critica { color: var(--color-critical); }

.prio-alta .prio-dot { background-color: var(--color-high); }
.prio-alta { color: var(--color-high); }

.prio-media-alta .prio-dot { background-color: var(--color-medium-high); }
.prio-media-alta { color: var(--color-medium-high); }

.prio-media .prio-dot { background-color: var(--color-medium); }
.prio-media { color: var(--color-medium); }

.prio-media-baja .prio-dot { background-color: var(--slate-medium); }
.prio-media-baja { color: var(--slate-medium); }

.prio-soporte .prio-dot { background-color: var(--slate-light); }
.prio-soporte { color: var(--slate-dark); }

/* Columna 3: Requerimiento */
.card-requirement {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.req-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-navy);
  line-height: 1.3;
}

.req-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--slate-medium);
}

.requester-badge {
  background: #f1f5f9;
  color: var(--slate-dark);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Columna 4: Brief */
.card-brief {
  display: flex;
  align-items: center;
}

.btn-brief-link {
  background: none;
  border: none;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  color: #0284c7;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-brief-link:hover {
  background: #e0f2fe;
  color: #0369a1;
  text-decoration: underline;
}

/* Columna 5: Progreso y Fecha (Barra a rayas diagonal del Mockup) */
.card-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.progress-header {
  display: flex;
  justify-content: flex-end;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--emerald-text);
}

.progress-track {
  width: 100%;
  height: 10px;
  background-color: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

/* Estilo idéntico al Mockup PDF: rayas verdes diagonales */
.progress-fill-striped {
  height: 100%;
  background-color: #22c55e;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.4),
    rgba(255, 255, 255, 0.4) 6px,
    transparent 6px,
    transparent 12px
  );
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-date {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-dark);
  text-align: center;
}

/* Columna 6: Revisión */
.card-review {
  display: flex;
  align-items: center;
}

.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.review-manana {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.review-manana .pulse-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.review-diseno {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.review-bocetos {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.review-cotizacion {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.review-aprobado {
  background: #10b981;
  color: #ffffff;
}

/* Columna 7: Descarga / Ver */
.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-dark);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-chip:hover {
  background: #e2e8f0;
  color: var(--primary-navy);
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.action-chip-canva {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #be185d;
}
.action-chip-canva:hover {
  background: #fce7f3;
  color: #9d174d;
}

.action-chip-sheet {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.action-chip-web {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

/* Columna 8: Aprobación (Checkbox grande cuadrado del Mockup) */
.card-approve {
  display: flex;
  justify-content: center;
  align-items: center;
}

.custom-checkbox {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.custom-checkbox input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 24px;
  width: 24px;
  background-color: #ffffff;
  border: 2px solid var(--card-border);
  border-radius: 5px;
  transition: all 0.2s ease;
}

.custom-checkbox:hover input ~ .checkmark {
  background-color: #f8fafc;
  border-color: #0284c7;
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--primary-navy);
  border-color: var(--primary-navy);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

/* ==========================================================================
   FOOTER EJECUTIVO
   ========================================================================== */

.dashboard-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--slate-medium);
}

.footer-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.separator {
  color: #cbd5e1;
}

.sync-indicator {
  color: #059669;
  font-weight: 600;
}

/* ==========================================================================
   MODALES (Brief y Stand)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.is-active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(10px);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.modal-card-large {
  max-width: 880px;
}

.modal-overlay.is-active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-code-badge {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  background: var(--primary-navy);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-navy);
}

.modal-subtitle {
  font-size: 13px;
  color: var(--slate-medium);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--slate-medium);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.modal-close-btn:hover {
  color: var(--primary-navy);
  background: #e2e8f0;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 13.5px;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-dark);
  cursor: pointer;
}

.btn-secondary:hover {
  background: #f1f5f9;
}

/* Secciones dentro del modal de Brief */
.brief-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brief-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--slate-medium);
}

.brief-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--primary-navy);
}

.brief-quote-box {
  background: #f0f9ff;
  border-left: 3.5px solid #0284c7;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #0369a1;
  font-size: 13px;
  line-height: 1.5;
}

.brief-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

/* Estilos de la ficha de plano de Stand */
.stand-blueprint-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.blueprint-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  position: relative;
}

.blueprint-badge {
  position: absolute;
  top: 18px;
  left: 20px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
}

.blueprint-svg {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.specs-table tr {
  border-bottom: 1px solid #f1f5f9;
}

.specs-table td {
  padding: 8px 10px;
}

.specs-table td:first-child {
  width: 200px;
  color: var(--slate-medium);
}

.highlight-badge {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ==========================================================================
   ADAPTABILIDAD RESPONSIVA
   ========================================================================== */

@media (max-width: 1100px) {
  .board-header-row,
  .deliverable-card {
    grid-template-columns: 45px 95px minmax(200px, 1.5fr) 90px 130px 130px minmax(140px, 1fr) 70px;
    gap: 8px;
  }
}

@media (max-width: 900px) {
  .dashboard-board {
    overflow-x: auto;
  }
  .board-header-row,
  .deliverable-card {
    min-width: 860px;
  }
}
