/* Identidad SEDVALLE: azul #033875, rojo #DC252B, amarillo #E6BE06 */
:root {
  --sed-azul: #033875;
  --sed-azul-oscuro: #022a58;
  --sed-rojo: #DC252B;
  --sed-amarillo: #E6BE06;
  --sed-gris-fondo: #f4f6f9;
  --sed-gris-borde: #d4dae3;
  --sed-texto: #1d2733;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--sed-texto);
  background: var(--sed-gris-fondo);
  margin: 0;
}

/* ---- Pantallas de acceso (Devise) ---- */
.devise-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--sed-azul) 0%, var(--sed-azul-oscuro) 60%, #01203f 100%);
  padding: 1rem;
}

.devise-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  width: 100%;
  max-width: 420px;
  padding: 2rem 2.25rem 2.25rem;
  box-sizing: border-box;
}

.devise-encabezado { text-align: center; margin-bottom: 1.5rem; }
.devise-encabezado h1 { margin: .75rem 0 .25rem; font-size: 1.5rem; color: var(--sed-azul); }
.devise-encabezado p { margin: 0; font-size: .9rem; color: #5a6673; }

.devise-marca { display: flex; justify-content: center; gap: 4px; }
.marca-franja { display: inline-block; width: 42px; height: 8px; border-radius: 4px; }
.franja-azul { background: var(--sed-azul); }
.franja-roja { background: var(--sed-rojo); }
.franja-amarilla { background: var(--sed-amarillo); }

.devise-panel form { display: flex; flex-direction: column; gap: 1rem; }

.campo label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; color: var(--sed-azul); }
.campo input[type="email"],
.campo input[type="password"],
.campo input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: .65rem .75rem;
  border: 1px solid var(--sed-gris-borde);
  border-radius: 8px;
  font-size: 1rem;
}
.campo input:focus { outline: 2px solid var(--sed-azul); outline-offset: 0; border-color: var(--sed-azul); }

.campo-recordarme { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: .7rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-primario { background: var(--sed-azul); color: #fff; width: 100%; }
.btn-primario:hover { background: var(--sed-azul-oscuro); }
.btn-secundario { background: #e9edf2; color: var(--sed-texto); }
.btn-secundario:hover { background: #dde3ea; }

.devise-links { margin-top: 1.25rem; text-align: center; font-size: .9rem; }
.devise-links a { color: var(--sed-azul); text-decoration: none; }
.devise-links a:hover { text-decoration: underline; color: var(--sed-rojo); }

.aviso { border-radius: 8px; padding: .6rem .9rem; font-size: .9rem; margin: 0 0 1rem; }
.aviso-ok { background: #e8f4ea; color: #1e6b2e; border: 1px solid #bfe0c6; }
.aviso-error { background: #fdecec; color: var(--sed-rojo); border: 1px solid #f5c2c4; }

.errores-formulario {
  background: #fdecec;
  border: 1px solid #f5c2c4;
  border-left: 4px solid var(--sed-rojo);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.errores-formulario h2 { margin: 0 0 .4rem; font-size: .95rem; color: var(--sed-rojo); }
.errores-formulario ul { margin: 0; padding-left: 1.2rem; }

/* ---- Barra de navegación ---- */
.navbar-app {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.5rem;
  background: var(--sed-azul);
  color: #fff;
  flex-wrap: wrap;
}
.navbar-marca { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.navbar-enlaces { display: flex; gap: 1rem; }
.navbar-enlaces a { color: #dce6f5; text-decoration: none; font-size: .9rem; }
.navbar-enlaces a:hover { color: #fff; text-decoration: underline; }
.navbar-usuario { display: flex; align-items: center; gap: .75rem; font-size: .85rem; color: #dce6f5; }
.navbar-notificaciones { display: inline-flex; align-items: center; gap: .3rem; }
.badge-notificaciones {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem;
  background: var(--sed-rojo); color: #fff; border-radius: 999px;
  font-size: .72rem; font-weight: 700; line-height: 1;
}
.lista-notificaciones .notificacion-no-leida { font-weight: 600; }

/* ---- Dashboard ---- */
.kpis-fila { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.kpi-tarjeta {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  padding: .9rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  min-width: 110px;
}
.kpi-numero { font-size: 1.6rem; font-weight: 700; color: var(--sed-azul); }
.kpi-etiqueta { font-size: .82rem; color: var(--sed-texto); }
.kpi-porcentaje { font-size: .78rem; color: #6b7684; }

.tendencia-grafico {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  height: 140px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  padding: 1rem 1.25rem .5rem;
}
.tendencia-columna { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1; height: 100%; gap: .3rem; }
.tendencia-valor { font-size: .8rem; font-weight: 700; color: var(--sed-azul); }
.tendencia-barra { width: 60%; min-height: 2px; background: var(--sed-azul); border-radius: 4px 4px 0 0; }
.tendencia-etiqueta { font-size: .72rem; color: #6b7684; }

.lista-dashboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.lista-dashboard li {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .92rem;
}
