/* ============================================
   SUMA - Sistema Unificado de Monitoreo y Acción
   Manual de Usuario - Hoja de estilos compartida
   ============================================ */

:root {
  /* Paleta corporativa */
  --verde-oscuro: #1E6B4A;
  --verde-medio: #3A9E6F;
  --verde-claro: #6DC49A;
  --verde-suave: #E2EEE9;
  --azul-corp: #1B3A6B;
  --azul-claro: #E8F4F8;
  --rojo-alerta: #DC2626;
  --naranja-alerta: #EA580C;
  --morado-alerta: #6D28D9;

  /* Neutros */
  --fondo: #F0F7F4;
  --fondo-side: #FAFCFB;
  --blanco: #FFFFFF;
  --gris-suave: #F5F9F7;
  --gris-claro: #E2EEE9;
  --gris-medio: #94A3B8;
  --gris-texto: #4A5568;
  --gris-fuerte: #1F2937;

  /* Sombras */
  --sombra-sutil: 0 2px 12px rgba(30, 107, 74, 0.06);
  --sombra: 0 4px 24px rgba(30, 107, 74, 0.10);
  --sombra-hover: 0 8px 40px rgba(30, 107, 74, 0.18);
  --sombra-fuerte: 0 12px 48px rgba(27, 58, 107, 0.22);
}

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

html, body {
  font-family: 'DM Sans', sans-serif;
  background: var(--fondo);
  color: var(--gris-fuerte);
  min-height: 100vh;
  line-height: 1.6;
  scroll-behavior: smooth;
}

/* ===== LAYOUT PRINCIPAL CON SIDEBAR ===== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 280px;
  background: var(--blanco);
  border-right: 1px solid var(--gris-claro);
  padding: 24px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--gris-claro);
  margin-bottom: 16px;
}

.sidebar-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--azul-corp), var(--verde-oscuro));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
  box-shadow: var(--sombra);
}

.sidebar-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--azul-corp);
  letter-spacing: -0.3px;
}

.sidebar-sub {
  font-size: 11px;
  color: var(--gris-medio);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  margin-top: 4px;
}

.sidebar-nav {
  padding: 0 12px;
}

.sidebar-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: var(--gris-medio);
  padding: 16px 12px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--gris-texto);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--verde-suave);
  color: var(--verde-oscuro);
}

.sidebar-link.active {
  background: linear-gradient(135deg, var(--verde-oscuro), var(--verde-medio));
  color: white;
  box-shadow: var(--sombra-sutil);
}

.sidebar-link-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gris-claro);
  margin-top: 24px;
  font-size: 11px;
  color: var(--gris-medio);
  line-height: 1.5;
}

.sidebar-footer strong {
  color: var(--verde-oscuro);
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  margin-left: 280px;
  padding: 0;
  min-height: 100vh;
}

/* ===== TOPBAR MOBILE ===== */
.topbar {
  display: none;
  background: var(--blanco);
  padding: 14px 20px;
  border-bottom: 1px solid var(--gris-claro);
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--verde-oscuro);
  padding: 4px;
}

.topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--azul-corp);
}

/* ===== HERO HEADER ===== */
.hero {
  background: linear-gradient(135deg, var(--azul-corp) 0%, var(--verde-oscuro) 100%);
  padding: 48px 40px;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.dot {
  width: 7px;
  height: 7px;
  background: var(--verde-claro);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 14px;
  letter-spacing: -1px;
}

.hero p {
  font-size: 17px;
  font-weight: 300;
  opacity: 0.92;
  max-width: 680px;
  line-height: 1.6;
}

/* ===== CONTENT WRAPPER ===== */
.content {
  padding: 48px 40px 64px;
  max-width: 1100px;
}

.section-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: var(--verde-oscuro);
  margin-bottom: 8px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--azul-corp);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  line-height: 1.2;
}

.section-sub {
  font-size: 16px;
  color: var(--gris-texto);
  margin-bottom: 32px;
  max-width: 720px;
  line-height: 1.7;
}

/* ===== ROL CHOOSER (landing) ===== */
.rol-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0 56px;
}

.rol-card {
  background: white;
  border-radius: 20px;
  padding: 32px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--sombra);
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
}

.rol-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-hover);
  border-color: var(--verde-medio);
}

.rol-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--azul-corp), var(--verde-medio));
}

.rol-card.manager::before {
  background: linear-gradient(90deg, var(--verde-medio), var(--verde-claro));
}

.rol-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--azul-claro), var(--verde-suave));
}

.rol-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--azul-corp);
  margin-bottom: 8px;
}

.rol-card-desc {
  font-size: 14px;
  color: var(--gris-texto);
  line-height: 1.6;
  margin-bottom: 18px;
}

.rol-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--verde-oscuro);
  font-weight: 600;
  font-size: 14px;
}

.rol-card-link::after {
  content: '→';
  transition: transform 0.2s;
}

.rol-card:hover .rol-card-link::after {
  transform: translateX(4px);
}

/* ===== INFO CARDS (landing) ===== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 28px 0 48px;
}

.info-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--sombra-sutil);
  border-left: 4px solid var(--verde-medio);
}

.info-card.alert { border-left-color: var(--rojo-alerta); }
.info-card.warn { border-left-color: var(--naranja-alerta); }
.info-card.info { border-left-color: var(--azul-corp); }
.info-card.purple { border-left-color: var(--morado-alerta); }

.info-card-icon {
  font-size: 24px;
  margin-bottom: 12px;
}

.info-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--azul-corp);
  margin-bottom: 6px;
}

.info-card-text {
  font-size: 13.5px;
  color: var(--gris-texto);
  line-height: 1.55;
}

/* ===== FILTROS Y BUSCADOR ===== */
.toolbar {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--sombra-sutil);
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border-radius: 12px;
  border: 1.5px solid var(--gris-claro);
  background: var(--gris-suave);
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  color: var(--gris-texto);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 16px center;
  margin-bottom: 14px;
}

.search-input:focus {
  border-color: var(--verde-medio);
  background: white;
}

.filtros {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filtro-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--gris-claro);
  background: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--gris-texto);
  cursor: pointer;
  transition: all 0.2s;
}

.filtro-btn.active {
  background: var(--verde-oscuro);
  border-color: var(--verde-oscuro);
  color: white;
}

.filtro-btn:hover:not(.active) {
  border-color: var(--verde-medio);
  color: var(--verde-oscuro);
}

.contador {
  font-size: 13px;
  color: var(--gris-medio);
  margin-bottom: 16px;
  font-weight: 500;
}

/* ===== CARDS DE COMANDOS ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 18px;
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--sombra);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeUp 0.4s ease both;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sombra-hover);
}

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

.card-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--gris-claro);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

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

.card-comando {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--azul-corp);
  margin-bottom: 3px;
}

.card-desc {
  font-size: 13px;
  color: var(--gris-texto);
  font-weight: 400;
  line-height: 1.45;
}

.card-tag {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.card-body { padding: 16px 20px 18px; flex: 1; }

.ejemplos-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--verde-oscuro);
  margin-bottom: 10px;
}

.ejemplo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  background: var(--gris-suave);
  border-radius: 10px;
  margin-bottom: 8px;
  border-left: 3px solid var(--verde-claro);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}

.ejemplo:last-child { margin-bottom: 0; }

.ejemplo:hover { background: var(--azul-claro); }

.ejemplo-texto {
  font-size: 13.5px;
  color: var(--azul-corp);
  font-weight: 500;
  line-height: 1.45;
  flex: 1;
}

.copiar-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 15px;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.ejemplo:hover .copiar-btn { opacity: 1; }

.copiar-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--verde-oscuro);
  color: white;
  padding: 11px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--sombra-fuerte);
  transition: transform 0.3s ease;
  z-index: 999;
  white-space: nowrap;
}

.copiar-toast.show { transform: translateX(-50%) translateY(0); }

/* ===== COLORES POR CATEGORIA ===== */
.cat-tarea .card-icon { background: #FFF4E6; }
.cat-consulta .card-icon { background: #E8F4F8; }
.cat-comentar .card-icon { background: #EBF5EE; }
.cat-actualizar .card-icon { background: #F3F0FF; }
.cat-info .card-icon { background: #FEF3C7; }
.cat-reasignar .card-icon { background: #FCE7F3; }
.cat-resumen .card-icon { background: #DBEAFE; }

.tag-tarea { background: #FFF4E6; color: #B05A00; }
.tag-consulta { background: #E8F4F8; color: var(--azul-corp); }
.tag-comentar { background: #EBF5EE; color: var(--verde-oscuro); }
.tag-actualizar { background: #F3F0FF; color: var(--morado-alerta); }
.tag-info { background: #FEF3C7; color: #92400E; }
.tag-reasignar { background: #FCE7F3; color: #BE185D; }
.tag-resumen { background: #DBEAFE; color: var(--azul-corp); }

.cat-tarea { border-top: 3px solid var(--naranja-alerta); }
.cat-consulta { border-top: 3px solid var(--azul-corp); }
.cat-comentar { border-top: 3px solid var(--verde-medio); }
.cat-actualizar { border-top: 3px solid var(--morado-alerta); }
.cat-info { border-top: 3px solid #F59E0B; }
.cat-reasignar { border-top: 3px solid #DB2777; }
.cat-resumen { border-top: 3px solid #2563EB; }

/* ===== SIN RESULTADOS ===== */
.sin-resultados {
  text-align: center;
  padding: 60px 20px;
  color: var(--gris-texto);
  display: none;
}

.sin-resultados .emoji { font-size: 44px; margin-bottom: 16px; }
.sin-resultados p { font-size: 15px; }

/* ===== NOTA AL PIE ===== */
.nota {
  margin-top: 28px;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(30, 107, 74, 0.06), rgba(27, 58, 107, 0.04));
  border-radius: 14px;
  border: 1px solid rgba(30, 107, 74, 0.12);
  font-size: 13.5px;
  color: var(--gris-texto);
  line-height: 1.6;
}

.nota strong { color: var(--verde-oscuro); }

/* ===== TIMELINE (alertas) ===== */
.timeline {
  margin: 24px 0 36px;
  position: relative;
}

.timeline-item {
  display: flex;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--gris-claro);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-time {
  flex-shrink: 0;
  width: 100px;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--verde-oscuro);
}

.timeline-content { flex: 1; }

.timeline-title {
  font-weight: 600;
  color: var(--azul-corp);
  font-size: 15px;
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 13.5px;
  color: var(--gris-texto);
  line-height: 1.55;
}

/* ===== FOOTER ===== */
.page-footer {
  margin-top: 40px;
  padding: 24px 0;
  border-top: 1px solid var(--gris-claro);
  font-size: 12px;
  color: var(--gris-medio);
  text-align: center;
}

.page-footer strong { color: var(--verde-oscuro); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--sombra-fuerte);
  }

  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }

  .topbar { display: flex; }

  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }

  .content { padding: 32px 24px 48px; }

  .section-title { font-size: 24px; }

  .rol-grid { grid-template-columns: 1fr; gap: 16px; }
  .info-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }

  .timeline-item { flex-direction: column; gap: 4px; }
  .timeline-time { width: auto; font-size: 18px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 24px; }
  .section-title { font-size: 21px; }
  .filtros { gap: 6px; }
  .filtro-btn { padding: 7px 13px; font-size: 12px; }
}

/* ===== OVERLAY MOBILE ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 90;
}

.overlay.show { display: block; }
