:root {
  --azul: #1a5276;
  --azul-claro: #eaf2f8;
  --gris: #f5f6f7;
  --borde: #d5dbdb;
  --texto: #2c3e50;
  --alta: #c0392b;
  --media: #b9770e;
  --baja: #1e8449;
  --ok: #1e8449;
}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 15px; color: var(--texto); background: var(--gris);
}
.oculto { display: none !important; }
.error { color: var(--alta); min-height: 1.2em; }

/* Acceso */
.acceso {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--azul) 0%, #15405c 100%);
}
.tarjeta-acceso {
  background: white; padding: 2.5rem; border-radius: 10px; width: 360px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25); text-align: center;
}
.tarjeta-acceso h1 { color: var(--azul); margin-bottom: .3rem; }
.tarjeta-acceso p { color: #666; font-size: .9rem; }
.tarjeta-acceso form { display: flex; flex-direction: column; gap: .8rem; margin-top: 1.5rem; }
input, select, textarea {
  padding: .6rem .8rem; border: 1px solid var(--borde); border-radius: 6px;
  font-size: .95rem; font-family: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul); border-color: var(--azul); }
button {
  padding: .6rem 1.2rem; border: none; border-radius: 6px; cursor: pointer;
  background: var(--azul); color: white; font-size: .95rem; font-family: inherit;
}
button:hover { background: #15405c; }
.boton-secundario { background: transparent; color: var(--azul); border: 1px solid var(--azul); }
.boton-secundario:hover { background: var(--azul-claro); }

/* Marco */
header {
  background: var(--azul); color: white; padding: 1rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
}
header h1 { margin: 0; font-size: 1.4rem; }
.subtitulo { font-size: .85rem; opacity: .85; }
header .boton-secundario { color: white; border-color: rgba(255,255,255,.6); }
header .boton-secundario:hover { background: rgba(255,255,255,.15); }

nav { background: white; border-bottom: 1px solid var(--borde); padding: 0 2rem; display: flex; flex-wrap: wrap; }
nav button {
  background: none; color: var(--texto); border: none; border-bottom: 3px solid transparent;
  border-radius: 0; padding: .9rem 1.1rem; font-size: .95rem;
}
nav button:hover { background: var(--azul-claro); }
nav button.activo { border-bottom-color: var(--azul); color: var(--azul); font-weight: 600; }

main { padding: 1.5rem 2rem; max-width: 1200px; margin: 0 auto; }
footer { padding: 1rem 2rem; color: #888; font-size: .8rem; text-align: center; }

/* Tarjetas y paneles */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tarjeta {
  background: white; border: 1px solid var(--borde); border-radius: 8px; padding: 1rem;
}
.tarjeta .numero { font-size: 2rem; font-weight: 700; color: var(--azul); }
.tarjeta .rotulo { font-size: .85rem; color: #666; }
.tarjeta.alerta .numero { color: var(--alta); }

.panel {
  background: white; border: 1px solid var(--borde); border-radius: 8px;
  padding: 1.2rem; margin-bottom: 1.2rem;
}
.panel h2 { margin: 0 0 .8rem; font-size: 1.1rem; color: var(--azul); }
.panel h3 { font-size: .95rem; margin: 1rem 0 .5rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { background: var(--azul-claro); color: var(--azul); }
tr:hover td { background: #fafbfc; }

/* Etiquetas de estado y prioridad */
.etiqueta {
  display: inline-block; padding: .15rem .55rem; border-radius: 12px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.p-Alta { background: #fdedec; color: var(--alta); }
.p-Media { background: #fef5e7; color: var(--media); }
.p-Baja, .p-Según { background: #eaeded; color: #566573; }
.p-Condicional { background: #eaeded; color: #566573; }
.e-pendiente { background: #eaeded; color: #566573; }
.e-en_curso { background: #eaf2f8; color: var(--azul); }
.e-hecho { background: #e9f7ef; color: var(--ok); }
.e-descartado { background: #f4ecf7; color: #7d3c98; }
.e-pendiente_fusion { background: #fef5e7; color: var(--media); }
.e-produccion { background: #e9f7ef; color: var(--ok); }
.e-planificado { background: #eaf2f8; color: var(--azul); }
.e-en_curso_d { background: #fef5e7; color: var(--media); }
.e-completado { background: #e9f7ef; color: var(--ok); }
.e-revertido { background: #fdedec; color: var(--alta); }
.e-abierto { background: #fdedec; color: var(--alta); }
.e-contenido { background: #fef5e7; color: var(--media); }
.e-resuelto, .e-cerrado { background: #e9f7ef; color: var(--ok); }
.sev-S1 { background: #c0392b; color: white; }
.sev-S2 { background: #e67e22; color: white; }
.sev-S3 { background: #f1c40f; color: #4d4d00; }
.sev-S4 { background: #95a5a6; color: white; }

/* Formularios de alta */
.form-alta { display: grid; gap: .6rem; grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
.form-alta .col-llena { grid-column: 1 / -1; }
textarea { resize: vertical; min-height: 60px; }

/* Checklist de despliegue */
.checklist { list-style: none; padding: 0; margin: .4rem 0; }
.checklist li { display: flex; gap: .6rem; align-items: flex-start; padding: .3rem 0; }
.checklist input[type="checkbox"] { width: auto; margin-top: .2rem; }
.checklist li.marcado span { text-decoration: line-through; color: #888; }

.acciones-fila { display: flex; gap: .4rem; }
.acciones-fila button { padding: .3rem .7rem; font-size: .8rem; }

select.en-fila { width: auto; padding: .3rem .5rem; font-size: .8rem; }

.nota { border-left: 3px solid var(--azul); background: var(--azul-claro); padding: .6rem .9rem; border-radius: 4px; font-size: .85rem; }
.mono { font-family: Consolas, monospace; font-size: .82rem; }

@media (max-width: 760px) {
  main { padding: 1rem; }
  header { padding: .8rem 1rem; }
  nav { padding: 0 .5rem; }
  .form-alta { grid-template-columns: 1fr; }
}
