:root {
  --azul: #1a5276;
  --azul-claro: #2874a6;
  --verde: #1e8449;
  --rojo: #c0392b;
  --amarillo: #b9770e;
  --gris-bg: #f4f6f8;
  --gris-borde: #dcdfe3;
  --texto: #2c3e50;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--gris-bg);
  color: var(--texto);
}

/* ---------- Login ---------- */
.login-bg {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
}
.login-card {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  width: 320px;
  text-align: center;
}
.login-card h1 { margin: 0 0 4px; color: var(--azul); }
.login-card .subtitle { margin: 0 0 20px; color: #888; font-size: .9em; }
.login-card label { display: block; text-align: left; font-size: .85em; margin-top: 12px; }
.login-card input {
  width: 100%; padding: 10px; margin-top: 4px;
  border: 1px solid var(--gris-borde); border-radius: 6px;
}
.login-card button {
  margin-top: 20px; width: 100%; padding: 10px; border: none;
  background: var(--azul); color: #fff; border-radius: 6px; cursor: pointer; font-size: 1em;
}
.login-card button:hover { background: var(--azul-claro); }
.alert { padding: 8px; border-radius: 6px; margin-bottom: 10px; font-size: .9em; }
.alert-error { background: #fdecea; color: var(--rojo); }

/* ---------- Navbar ---------- */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--azul); color: #fff; padding: 12px 24px;
}
.nav-brand { font-weight: bold; font-size: 1.1em; }
.nav-links a { color: #dce8f2; text-decoration: none; margin-right: 18px; }
.nav-links a:hover { color: #fff; text-decoration: underline; }
.nav-user { display: flex; align-items: center; gap: 12px; font-size: .9em; }
.nav-user a { color: #fff; }

/* ---------- Layout ---------- */
.container { max-width: 1300px; margin: 24px auto; padding: 0 20px; }
h1 { color: var(--azul); font-size: 1.4em; }

/* ---------- Filtros ---------- */
.filtros {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: end;
  background: #fff; padding: 16px; border-radius: 10px;
  border: 1px solid var(--gris-borde); margin-bottom: 16px;
}
.campo { display: flex; flex-direction: column; font-size: .85em; }
.campo-grande { flex: 1; min-width: 220px; }
.campo label { margin-bottom: 4px; color: #555; }
.campo input, .campo select {
  padding: 8px; border: 1px solid var(--gris-borde); border-radius: 6px; font-size: .95em;
}
button {
  padding: 9px 16px; border: none; border-radius: 6px;
  background: var(--azul); color: #fff; cursor: pointer; font-size: .9em;
}
button:hover { background: var(--azul-claro); }
button.secundario { background: #7f8c8d; }
button.secundario:hover { background: #626e6f; }

/* ---------- Resumen ---------- */
.resumen { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.resumen .tarjeta {
  background: #fff; border: 1px solid var(--gris-borde); border-radius: 8px;
  padding: 12px 18px; min-width: 160px;
}
.resumen .tarjeta .valor { font-size: 1.3em; font-weight: bold; }
.resumen .tarjeta .etiqueta { font-size: .8em; color: #777; }
.resumen .ingreso .valor { color: var(--verde); }
.resumen .salida .valor { color: var(--rojo); }

/* ---------- Tabla ---------- */
.tabla-wrap { background: #fff; border-radius: 10px; overflow-x: auto; border: 1px solid var(--gris-borde); }
table { width: 100%; border-collapse: collapse; font-size: .88em; }
thead th {
  background: #eaf1f6; color: var(--azul); text-align: left;
  padding: 10px; position: sticky; top: 0; white-space: nowrap;
}
tbody td { padding: 8px 10px; border-top: 1px solid #eee; white-space: nowrap; }
tbody tr:hover { background: #f8fafb; }
.badge { padding: 3px 8px; border-radius: 12px; font-size: .78em; font-weight: 600; }
.badge-Ingreso { background: #eafaf1; color: var(--verde); }
.badge-Salida { background: #fdecea; color: var(--rojo); }
.badge-Transferencia { background: #eaf2fb; color: var(--azul); }
.badge-Cheque { background: #fdf2e3; color: var(--amarillo); }
.badge-Otro, .badge-Anulado { background: #eee; color: #666; }
.estado-Conciliado { color: var(--verde); }
.estado-Pendiente-Banco { color: var(--amarillo); }
.estado-No-Registrado { color: var(--rojo); }
.estado-Diferencia { color: var(--rojo); font-weight: bold; }
.estado-Sin-Revisar { color: #999; }

.paginacion { display: flex; gap: 8px; margin-top: 14px; justify-content: center; }
.paginacion button { background: #fff; color: var(--azul); border: 1px solid var(--gris-borde); }
.paginacion button.activo { background: var(--azul); color: #fff; }

/* ---------- Import / Conciliación pages ---------- */
.card { background: #fff; border: 1px solid var(--gris-borde); border-radius: 10px; padding: 20px; margin-bottom: 18px; }
.card h3 { margin-top: 0; color: var(--azul); font-size: 1.05em; }
.ayuda { color: #777; font-size: .88em; margin-top: -6px; }

/* ---------- Encabezado tipo "panel" (como tus capturas) ---------- */
.panel-header {
  background: var(--azul); border-radius: 10px 10px 0 0;
  padding: 18px 22px; margin-bottom: 0;
  display: flex; flex-direction: column;
}
.panel-header + .card { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 0; }
.panel-sub { color: #cfe0ec; font-size: .85em; margin-top: 2px; }

/* ---------- Formularios de administración (Usuarios, Cuentas) ---------- */
.fila-form { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.fila-form .campo { min-width: 160px; }
.campo-check { justify-content: end; }
.campo-check label { display: flex; align-items: center; gap: 6px; font-size: .9em; }

.permisos-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 20px; background: #f8fafb; border: 1px solid var(--gris-borde);
  border-radius: 8px; padding: 14px; margin-bottom: 16px;
}
.permiso-item { display: flex; align-items: center; gap: 8px; font-size: .9em; }

.acciones-form { display: flex; gap: 10px; }
.acciones-form button.secundario { background: #7f8c8d; }
.acciones-form button.secundario:hover { background: #626e6f; }
