/* ══════════════════════════════════════════════════════════════════════
   NIGC · Modelo de auditoría (Materialidad + Balance + Grupos) — estilos
   Paleta NIGC (navy #0d1b4b / teal #0d9488). Responsive (1024/600).
   ══════════════════════════════════════════════════════════════════════ */
/* Alineado a la IZQUIERDA y a todo el ancho disponible: las cédulas tienen muchas columnas
   y el centrado (margin:0 auto con tope 1180px) dejaba un hueco grande a la izquierda. */
.am-wrap { max-width: 100%; margin: 0; }
.am-h1 { font-size: 1.6rem; color: #0d1b4b; margin: 0 0 4px; }
.am-sub { color: #64748b; font-size: .9rem; margin: 0 0 16px; }

.am-filtros { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.am-filtros > div { display: flex; flex-direction: column; gap: 3px; min-width: 240px; flex: 1; }
.am-filtros label { font-size: .76rem; font-weight: 700; color: #0d1b4b; }
.am-filtros select { padding: 9px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }

/* Navegación de sub-tabs en COLUMNA a la izquierda (estilo lista de secciones); contenido a la derecha. */
.am-layout { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.am-tabs { display: flex; flex-direction: column; gap: 5px; flex: 0 0 214px; width: 214px; margin: 0; }
.am-tab { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; text-align: left; width: 100%;
  padding: 8px 11px; font-size: .8rem; font-weight: 600; color: #334155; cursor: pointer;
  white-space: normal; line-height: 1.25; }
.am-tab:hover { border-color: #94a3b8; }
.am-tab.active { background: #0d9488; border-color: #0d9488; color: #fff; }
#am-body { flex: 1 1 auto; min-width: 0; }
/* Columna de pasos colapsada: se oculta y el contenido ocupa todo el ancho (ver el encargo mejor). */
.am-layout.tabs-hidden .am-tabs { display: none; }
/* En pantallas angostas, la navegación vuelve a fila horizontal para no comer ancho. */
@media (max-width: 900px) {
  .am-layout { flex-direction: column; }
  .am-tabs { flex-direction: row; flex-wrap: wrap; width: auto; flex: none;
    border-bottom: 2px solid #e2e8f0; padding-bottom: 6px; }
  .am-tab { width: auto; }
}

.am-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.am-card h3 { margin: 0 0 12px; color: #0d1b4b; font-size: 1.05rem; }
.am-empty, .am-loading { text-align: center; color: #94a3b8; padding: 26px; font-size: .92rem; }
.am-hint { font-size: .8rem; color: #64748b; margin: 0 0 12px; }

.am-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.am-grid2 label, .am-card > label { display: block; font-size: .76rem; font-weight: 700; color: #0d1b4b; margin: 8px 0 3px; }
.am-grid2 input, .am-grid2 select, .am-card textarea, .am-card > input {
  width: 100%; padding: 9px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; font: inherit; }

.am-btn { background: #0d9488; color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font-weight: 700;
  cursor: pointer; font-size: .88rem; margin-top: 10px; text-decoration: none; display: inline-block; }
.am-btn:hover { background: #0f766e; }
.am-btn.ghost { background: #fff; color: #0d9488; border: 1px solid #0d9488; }
.am-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.am-tablewrap { overflow-x: auto; }
.am-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.am-table th { text-align: left; background: #f1f5f9; color: #0d1b4b; padding: 8px 10px; font-size: .76rem;
  text-transform: uppercase; letter-spacing: .4px; }
.am-table td { padding: 8px 10px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }

.am-badge { font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.am-badge.ok { background: #dcfce7; color: #166534; }
.am-badge.bor { background: #fef9c3; color: #854d0e; }
.am-badge.rev { background: #dbeafe; color: #1e40af; }

.am-mini { border: 0; border-radius: 6px; padding: 4px 9px; font-size: .74rem; font-weight: 700; cursor: pointer; }
.am-mini.ok { background: #0d9488; color: #fff; }
.am-mini.del { background: #fee2e2; color: #b91c1c; }

/* Balance */
.am-bal { border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.am-bal-hd { font-size: .9rem; color: #0d1b4b; margin-bottom: 8px; }
.am-bal-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.am-bk { background: #f8fafc; border-radius: 8px; padding: 8px 10px; }
.am-bk .l { font-size: .68rem; color: #64748b; text-transform: uppercase; font-weight: 700; }
.am-bk .n { font-size: .95rem; color: #0d1b4b; font-weight: 800; }
.am-bal-ft { font-size: .78rem; color: #94a3b8; margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.am-bal-obs { margin-top: 8px; padding: 7px 10px; border-radius: 8px; background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; font-weight: 600; font-size: .78rem; line-height: 1.45; }

/* Grupos */
.am-grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.am-grupo { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; cursor: pointer;
  text-align: center; transition: all .15s; }
.am-grupo:hover { border-color: #0d9488; transform: translateY(-2px); }
.am-grupo.sel { border-color: #0d9488; background: #f0fdfa; box-shadow: 0 0 0 2px #0d948833; }
.am-grupo-ic { font-size: 1.5rem; }
.am-grupo-nm { font-size: .8rem; font-weight: 700; color: #0d1b4b; margin: 4px 0; min-height: 2.2em; }
.am-grupo-sal { font-size: .8rem; color: #0d9488; font-weight: 800; }
.am-grupo-bar { height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin: 6px 0 3px; }
.am-grupo-bar span { display: block; height: 100%; background: #0d9488; border-radius: 3px; }
.am-grupo-pr { font-size: .72rem; color: #64748b; }

.am-aser { font-size: .68rem; font-weight: 800; background: #ede9fe; color: #5b21b6; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.am-pt { width: 70px; padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .78rem; }
.am-estado { padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .76rem; font-weight: 700; }
.am-estado.est-COMPLETADO { background: #dcfce7; color: #166534; }
.am-estado.est-EN_PROCESO { background: #dbeafe; color: #1e40af; }
.am-estado.est-NA { background: #f1f5f9; color: #64748b; }

/* Hallazgos + evaluación NIA 450 */
.am-eval-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.am-verdict { border: 2px solid; border-radius: 12px; padding: 14px 16px; }
.am-verdict-op { font-size: 1.05rem; font-weight: 900; }
.am-verdict-msg { font-size: .85rem; color: #334155; margin: 4px 0; }
.am-verdict-meta { font-size: .74rem; color: #64748b; }
.am-subform { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; margin: 10px 0; }
.am-subform label { display: block; font-size: .76rem; font-weight: 700; color: #0d1b4b; margin: 8px 0 3px; }
.am-subform input, .am-subform select, .am-subform textarea {
  width: 100%; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; font: inherit; }
.am-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.am-mut { font-size: .72rem; color: #94a3b8; }

/* Dossier / compuertas NIGC 1-2 */
.am-prep { border: 3px solid; border-radius: 14px; padding: 10px 18px; text-align: center; min-width: 130px; }
.am-prep-n { font-size: 1.7rem; font-weight: 900; line-height: 1; }
.am-prep-l { font-size: .72rem; color: #64748b; margin-top: 3px; }
.am-gates { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; margin-top: 14px; }
.am-gate { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; }
.am-gate.ok { background: #f0fdf4; border-color: #bbf7d0; }
.am-gate.no { background: #fef2f2; border-color: #fecaca; }
.am-gate-ic { font-size: 1.1rem; }
.am-gate-lb { font-size: .85rem; font-weight: 700; color: #0d1b4b; }
.am-gate-norma { font-size: .66rem; font-weight: 800; background: #e0e7ff; color: #3730a3; padding: 1px 6px; border-radius: 6px; margin-left: 4px; }

@media (max-width: 600px) {
  .am-filtros > div { min-width: 100%; }
  .am-grupos { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ── Enfoque de sistema del Control Interno: entrada → proceso → salida → conclusión ── */
.ci-sys-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.ci-sys-card { flex: 1 1 220px; min-width: 220px; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.ci-sys-arrow { align-self: center; font-size: 22px; color: #94a3b8; font-weight: 800; padding: 0 2px; }
.ci-sys-head { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.ci-sys-num { color: #fff; font-weight: 800; border-radius: 8px; min-width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 auto; }
.ci-sys-tit { font-weight: 800; font-size: 14px; }
.ci-sys-preg { font-size: 11.5px; color: #64748b; font-style: italic; }
.ci-sys-desc { font-size: 12px; color: #475569; line-height: 1.45; margin-bottom: 8px; flex: 1; }
.ci-sys-status { margin-bottom: 8px; min-height: 22px; }
.ci-sys-tools { display: flex; flex-direction: column; gap: 5px; }
.ci-sys-tool { text-align: left; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 6px 9px; font-size: 11.7px; color: #0f172a; cursor: pointer; display: flex;
  align-items: center; gap: 6px; transition: background .12s, border-color .12s; }
.ci-sys-tool:hover { background: #eef2ff; border-color: #c7d2fe; }
.ci-sys-go { margin-left: auto; color: #94a3b8; font-weight: 700; }
@media (max-width: 1024px) {
  .ci-sys-arrow { transform: rotate(90deg); width: 100%; text-align: center; }
  .ci-sys-card { flex: 1 1 100%; }
}

/* Segregación de funciones: línea separadora entre filas un poco más oscura y visible. */
.sod-grid tbody td { border-bottom: 1.5px solid #94a3b8; }
.sod-grid thead th { border-bottom: 2px solid #64748b; }

/* Segregación de funciones: estética de la cuadrícula (zebra, foco, campos limpios). */
.sod-grid thead th { padding: 8px 7px; background: #eef2f7; }
.sod-grid tbody td { padding: 5px 7px; vertical-align: middle; border-bottom: 1px solid #dbe1e8; }
.sod-grid tbody tr:nth-child(even) { background: #fafbfc; }
.sod-grid tbody tr:hover { background: #eef6f5; }
.sod-grid textarea.am-mini,
.sod-grid input.am-mini,
.sod-grid select.am-mini {
  border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 8px;
  background: #fff; font: inherit; color: #0f172a; box-sizing: border-box;
}
.sod-grid textarea.am-mini { min-height: 40px; line-height: 1.35; resize: vertical; }
.sod-grid textarea.am-mini:focus,
.sod-grid input.am-mini:focus,
.sod-grid select.am-mini:focus {
  outline: none; border-color: #0d9488; box-shadow: 0 0 0 2px rgba(13, 148, 136, .15);
}
