/* Módulo Saturación de FAT — Estilos responsivos PC y Móvil (<= 768px) */

.sat-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  overflow-x: clip;
}

.sat-shell *:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .sat-shell *,
  .sat-card-btn,
  .sat-kpi {
    transition: none !important;
    animation: none !important;
  }
}

.sat-header-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.sat-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Sec. 4.3 Banner destacado: Mis pendientes -> Materiales por declarar */
.sat-pending-mat-panel {
  border: 2px solid #b45309;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  color: #451a03;
}

.sat-pending-mat-panel.is-clear {
  border-color: #15803d;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #14532d;
}

.sat-pending-mat-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.sat-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: #b45309;
  color: #ffffff;
}

.sat-pending-mat-panel.is-clear .sat-count-pill {
  background: #15803d;
}

.sat-pending-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.sat-pending-item {
  background: #ffffff;
  border: 1px solid #d97706;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sat-pending-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.sat-pending-meta {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.35;
}

/* Badges explícitos en texto (no solo color) */
.sat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.sat-badge-hist { background: #e2e8f0; color: #1e293b; border-color: #94a3b8; }
.sat-badge-op { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.sat-badge-ok { background: #dcfce7; color: #166534; border-color: #86efac; }
.sat-badge-warn { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.sat-badge-danger { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.sat-badge-info { background: #f3e8ff; color: #6b21a8; border-color: #d8b4fe; }

/* KPI grid & evolución anual */
.sat-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
}

.sat-kpi {
  text-align: left;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sat-kpi:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.sat-kpi.is-active {
  border-color: #0369a1;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.22);
}

.sat-kpi-label {
  font-size: 0.76rem;
  color: #475569;
  font-weight: 600;
}

.sat-kpi-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.sat-year-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.sat-year-chip {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.sat-year-chip.is-active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Tabs */
.sat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 0.45rem;
}

.sat-tab-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.sat-tab-btn.is-active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Filtros */
.sat-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.55rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
}

.sat-filter-field label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.2rem;
}

.sat-filter-field input,
.sat-filter-field select {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
}

/* Tabla PC vs tarjetas móvil */
.sat-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.sat-mobile-cards {
  display: none;
  flex-direction: column;
  gap: 0.65rem;
}

.sat-mobile-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Agenda diaria */
.sat-agenda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.sat-agenda-bucket {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sat-agenda-card {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.6rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Ficha de Saturación FAT */
.sat-detail-banner-hist {
  border: 1px solid #64748b;
  background: #f1f5f9;
  color: #0f172a;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.sat-detail-banner-op {
  border: 1px solid #3b82f6;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.sat-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.85rem;
}

.sat-group-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.85rem;
}

.sat-group-card summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.65rem;
}

.sat-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 0.55rem;
}

.sat-field-ro {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
}

.sat-copy-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.72rem;
  cursor: pointer;
}

/* Sec 4.3 Declaración de Materiales */
.sat-mat-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sat-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.45rem;
}

.sat-quick-item {
  text-align: left;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.sat-quick-item:hover {
  border-color: #0284c7;
  background: #e0f2fe;
}

.sat-preview-html {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.85rem;
  background: #ffffff;
  overflow-x: auto;
  max-height: 460px;
}

.sat-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.65rem;
}

.sat-photo-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.5rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sat-photo-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  background: #f1f5f9;
}

@media (max-width: 768px) {
  .sat-desktop-only {
    display: none !important;
  }

  .sat-mobile-cards {
    display: flex;
  }

  .sat-groups-grid,
  .sat-agenda-grid,
  .sat-pending-list,
  .sat-filter-grid,
  .sat-form-grid {
    grid-template-columns: 1fr;
  }

  .sat-header-actions {
    width: 100%;
  }

  .sat-header-actions .btn {
    flex: 1 1 auto;
  }
}

/* Acordeones de contexto histórico y filtros avanzados */
.sat-collapsible {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
}

.sat-collapsible > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.86rem;
  color: #1e293b;
  user-select: none;
}

.sat-collapsible[open] > summary {
  margin-bottom: 0.65rem;
}

.sat-active-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 0.8rem;
}

/* Tablas visuales idénticas a correos de Claro (Nataly Sec. 4.1 y 4.2) */
.sat-nataly-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.76rem;
  color: #334155;
  margin-bottom: 0.4rem;
}

.sat-color-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1px solid #000000;
  vertical-align: middle;
  margin-right: 3px;
}

.sat-nataly-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000000;
  font-family: Aptos, Calibri, 'Segoe UI', sans-serif;
  font-size: 0.78rem;
  background: #ffffff;
}

.sat-nataly-table th,
.sat-nataly-table td {
  border: 1px solid #000000;
  padding: 4px 6px;
  vertical-align: middle;
}

.sat-nataly-table th {
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.sat-nataly-table td input,
.sat-nataly-table td select {
  width: 100%;
  min-width: 68px;
  box-sizing: border-box;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.78rem;
  background: #ffffff;
  color: #000000;
}

.sat-nataly-table th.nat-navy { background: #002060; color: #ffffff; }
.sat-nataly-table th.nat-navy-top { background: #002060; color: #ffffff; border-bottom: none; }
.sat-nataly-table th.nat-navy-bot { background: #002060; color: #ffffff; border-top: none; }
.sat-nataly-table th.nat-soft-green { background: #8ED973; color: #000000; font-weight: 600; }
.sat-nataly-table th.nat-green { background: #70AD47; color: #000000; }
.sat-nataly-table th.nat-cyan { background: #00B0F0; color: #000000; }
.sat-nataly-table th.nat-pale-green { background: #A9D08E; color: #000000; }
.sat-nataly-table th.nat-yellow { background: #FFFF00; color: #000000; }
.sat-nataly-table th.nat-util { background: #f1f5f9; color: #0f172a; }

.sat-draft-callout {
  border: 1px solid #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
}
