/* ==========================================================================
    RED SYNAPTICO — Barra de tabs + botón Crear
    Paleta de marca: navy #1B2A4A / naranja #F97316
   ========================================================================== */

:root {
  --red-primary: #1B2A4A;
  --red-accent: #F97316;
  --red-accent-hover: #EA6A0C;
  --red-muted: #64748b;
  --red-border: #e2e8f0;
}

.red-tabs-wrapper {
  margin-bottom: 24px;
}

/* Fila: tabs a la izquierda, botón Crear a la derecha */
.red-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--red-border);
}

/* ================= TABS ================= */
.red-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.red-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--red-muted);
  white-space: nowrap;
  transition: color .15s ease;
}

.red-tab:hover {
  color: var(--red-primary);
}

.red-tab.active {
  color: var(--red-primary);
}

/* Línea bajo el tab activo */
.red-tab.active::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  background-color: var(--red-accent);
  border-radius: 2px 2px 0 0;
}

/* Badge (ej. Mensajes "2") */
.red-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background-color: #e2e8f0;
  color: var(--red-primary);
  font-size: 11px;
  font-weight: 700;
}

.red-tab.active .red-tab-badge {
  background-color: var(--red-accent);
  color: #fff;
}

/* ================= SUBTÍTULO (bajo el título, fijo) ================= */
/* Vive en la cabecera de la vista (.red-page-header), no en la barra. */

/* ================= BOTÓN CREAR + DROPDOWN ================= */
.red-create-wrapper {
  position: relative;
  flex-shrink: 0;
}

.red-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background-color: var(--red-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease;
}

.red-create-btn:hover {
  background-color: var(--red-accent-hover);
}

.red-create-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: #fff;
  border: 1px solid var(--red-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  padding: 6px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}

.red-create-wrapper.open .red-create-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.red-create-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--red-primary);
  transition: background-color .15s ease;
}

.red-create-item:hover {
  background-color: #f8fafc;
}

.red-create-item i {
  font-size: 18px;
  color: var(--red-accent);
  margin-top: 2px;
  flex-shrink: 0;
}

.red-create-item div {
  display: flex;
  flex-direction: column;
}

.red-create-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--red-primary);
}

.red-create-item-sub {
  font-size: 11.5px;
  color: var(--red-muted);
  line-height: 1.4;
}

/* ================= PANELES DE CONTENIDO ================= */
/* Cada panel se muestra/oculta según el tab activo (red-tabs.js).
   El contenido de cada panel va en la vista, no en este partial. */
.red-tab-panel {
  display: none;
}

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


.container:has(> .red-page),
.container:has(.red-page) {
  width: 100% !important;
  max-width: 1280px !important;
  margin: 0 auto !important;
  box-sizing: border-box;
}

.red-page {
  width: 100% !important;
  padding-top: 100px !important;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .red-tabs-bar {
    flex-wrap: wrap;
  }

  .red-create-wrapper {
    order: -1;
    margin-left: auto;
    margin-bottom: 8px;
  }

  .red-create-menu {
    min-width: 240px;
  }
}