* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; color: #222; background: #f5f7fa; line-height: 1.5; }
header { background: #1f3a5f; padding: 0 1rem; }
nav { max-width: 960px; margin: auto; display: flex; flex-wrap: wrap; gap: .25rem; }
nav > a, .grupo > button { color: #dce6f2; text-decoration: none; padding: .9rem 1rem; background: none; border: 0; font: inherit; cursor: pointer; display: block; }
nav > a:hover, nav > a[aria-current], .grupo:hover > button, .grupo:focus-within > button, .grupo.activo > button { background: #2d5282; color: #fff; }
.grupo { position: relative; }
.sub { display: none; position: absolute; left: 0; top: 100%; min-width: 250px; background: #1f3a5f; z-index: 10; box-shadow: 0 6px 14px rgba(0,0,0,.25); }
.grupo:hover .sub, .grupo:focus-within .sub { display: block; }
.sub a { display: block; color: #dce6f2; text-decoration: none; padding: .7rem 1rem; }
.sub a:hover, .sub a[aria-current] { background: #2d5282; color: #fff; }
main { max-width: 960px; margin: 2rem auto; padding: 0 1rem; }
footer { text-align: center; color: #667; padding: 2rem 1rem; font-size: .85rem; }
.hero { text-align: center; padding: 2rem 0 .5rem; }
.hero h1 { margin-bottom: .25rem; }
h2 { color: #1f3a5f; margin: 2rem 0 .8rem; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tarjeta { background: #fff; border-radius: 8px; padding: 1.2rem; text-decoration: none; color: inherit; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.tarjeta:hover { box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.tarjeta h3 { margin: 0 0 .4rem; color: #1f3a5f; }
.tarjeta p { margin: 0; color: #556; font-size: .95rem; }
.nota { color: #556; margin-top: -.5rem; }
form { background: #fff; padding: 1.2rem; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.12); display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; align-items: end; }
form > [hidden] { display: none; }
.ancho { grid-column: 1 / -1; overflow-x: auto; }
label { display: grid; gap: .25rem; font-size: .9rem; font-weight: 600; }
input, select { padding: .5rem; border: 1px solid #bbb; border-radius: 4px; font: inherit; width: 100%; }
input.dato { background: #fffde0; }
button[type=submit] { grid-column: 1 / -1; padding: .7rem; border: 0; border-radius: 4px; background: #1f3a5f; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
button[type=submit]:hover { background: #2d5282; }
button.secundario { padding: .5rem .8rem; border: 1px solid #1f3a5f; border-radius: 4px; background: #fff; color: #1f3a5f; font: inherit; cursor: pointer; }
button.secundario:hover { background: #e8eef7; }
#error { color: #c0392b; min-height: 1.4em; }
#resultado { background: #fff; padding: 1.2rem; border-radius: 8px; margin-top: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.resumen { margin: 0 0 1rem; }
.resumen div { display: flex; flex-wrap: wrap; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid #edf0f4; }
.resumen dt { font-weight: 600; min-width: 230px; color: #1f3a5f; }
.resumen dd { margin: 0; }
table.datos { border-collapse: collapse; margin: .5rem 0 1rem; }
table.datos th, table.datos td { border: 1px solid #d5dbe3; padding: .4rem .7rem; text-align: center; }
table.datos thead th { background: #eef2f7; }
table.datos input { min-width: 90px; text-align: center; }
.decision { padding: .8rem; text-align: center; font-weight: 700; border-radius: 4px; }
.decision.ok { background: #d5f5e3; color: #1e8449; }
.decision.no { background: #fadbd8; color: #922b21; }
canvas { width: 100%; height: auto; margin-top: 1rem; }
