/* ── global.css ── */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', Tahoma, sans-serif;
  line-height: 1.7;
  color: #172033;
  background: #f4f6f9;
  font-size: 14px;
}

/* ── Typography ── */
h1, h2, h3, h4 { color: #172033; margin-bottom: 12px; }
h1 { font-size: 26px; font-weight: 900; color: #7a0f2f; border-bottom: 3px solid #7a0f2f; padding-bottom: 10px; margin-bottom: 30px; }
h2 { font-size: 20px; font-weight: 800; color: #1d4ed8; margin-top: 36px; border-left: 4px solid #b8892f; padding-left: 12px; }
h3 { font-size: 16px; font-weight: 700; color: #374151; margin-top: 24px; }
p { margin-bottom: 14px; color: #4b5563; text-align: justify; }

/* ── UI Elements — Badges ── */
.badge.rf    { background: #dbeafe; color: #1e40af; box-shadow: 0 1px 3px rgba(30,64,175,.15); }
.badge.rnf   { background: #fee2e2; color: #991b1b; box-shadow: 0 1px 3px rgba(153,27,27,.15); }
.badge.sprint{ background: #fef3c7; color: #92400e; }
.badge.obs   { background: #e0e7ff; color: #3730a3; }
.badge.must  { background: #dbeafe; color: #1e3a5f; }
.badge.should{ background: #ede9fe; color: #5b21b6; }
.badge.could { background: #d1fae5; color: #065f46; }
.badge.ok    { background: #d1fae5; color: #065f46; }
.badge.warn  { background: #fef3c7; color: #92400e; }
.badge.danger{ background: #fee2e2; color: #991b1b; }

/* ── Tables ── */
.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
  background: #fff;
  box-shadow: 0 2px 14px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.04);
  border-radius: 10px;
  overflow: hidden;
  table-layout: fixed;
  border: 1px solid #e8eaed;
}
.tbl th {
  background: linear-gradient(135deg, #1e3a5f 0%, #172033 100%);
  color: #fff;
  font-weight: 700;
  padding: 13px 16px;
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tbl th:nth-child(1) { width: 10%; } /* Cód. */
.tbl th:nth-child(2) { width: 12%; } /* Tipo */
.tbl th:nth-child(3) { width: 50%; } /* Descripción */
.tbl th:nth-child(4) { width: 14%; } /* Fuente */
.tbl th:nth-child(5) { width: 14%; } /* Trazabilidad */
.tbl td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
  word-wrap: break-word;
  transition: background 0.12s ease;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f0f5ff !important; }
.tbl tr:nth-child(even) td { background: #fafbfd; }
.tbl .code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #7a0f2f;
  white-space: nowrap;
  background: #fdf2f4;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}
/* RF row: borde izquierdo azul — RNF: rojo */
.tbl tr:has(.badge.rf) td:first-child { border-left: 3px solid #1d4ed8; }
.tbl tr:has(.badge.rnf) td:first-child { border-left: 3px solid #dc2626; }

/* Tabla sin columnas fijas (ej. tabla de 3 cols) */
.tbl.auto-cols { table-layout: auto; }
.tbl.auto-cols th { width: auto; }

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ── Cards & Alerts ── */
.alert { background: #fff7ed; border-left: 4px solid #f59e0b; padding: 12px 16px; margin: 16px 0; border-radius: 0 8px 8px 0; font-size: 13px; color: #7c2d12; }
.card { background: #fff; border: 1px solid #e2e5ea; border-radius: 8px; padding: 20px; margin-bottom: 24px; box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.card-title { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: #647084; margin-bottom: 12px; border-bottom: 1px solid #f3f4f6; padding-bottom: 8px; }

/* ── Lists ── */
ul.custom-list { list-style: none; margin: 12px 0; }
ul.custom-list li { margin-bottom: 8px; padding-left: 24px; position: relative; color: #374151; }
ul.custom-list li::before { content: "\f058"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; left: 0; top: 2px; color: #10b981; }

/* ── Responsive Grids & Layouts ── */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 600px), 1fr));
  gap: 30px;
  align-items: start;
}

.grid-item h2 {
  margin-top: 0;
}

/* ── Table Responsive Wrapper ── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  margin: 20px 0;
  background: #fff;
  /* Scroll styling */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}
.table-responsive::-webkit-scrollbar {
  height: 8px;
}
.table-responsive::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 8px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 8px;
}
.table-responsive .tbl {
  margin: 0;
  box-shadow: none;
  min-width: 800px; /* Forces scroll on small screens */
}
